Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 05 · From Scratch · Git · with code: Go · about 13 min to read

Play it as a journeyTutor comes with a plan

Git 04 and 05: Log and Checkout

IaC and GitOps
IaC and GitOps · Open board

The board where “rollback = git revert” and “audit = git log” are one-liners. This lesson builds the two commands those lines lean on: reading history back, and putting a folder back the way a commit had it.

Before you start. Git 03: Commits, Refs and HEAD made the commit: a top tree, a parent hash, an author and a message, with a branch file holding the newest one and HEAD naming the branch. Each commit points at its parent, so the history is a chain you can follow backwards. A root commit is the first one, the one with no parent line. This lesson covers two stages, because each is short: 04-log walks the chain, and 05-checkout rebuilds a folder from it.

Lesson 36 of 117 in From Scratch

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 16 April 2005: a commit with no past
  • Log: follow the parent until there is none
  • Checkout: make the folder match a commit
  • The rule that protects your work
  • Branch or hash: attached and detached
  • Real git clones it

Terms it explains: root commit, linked list, detached, `formatDate`, `logCmd`, `treeFiles`, `filesOf`, `checkout`, Mistakes this stage invites, IaC.

Review From Scratch