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 12 min to read

Play it as a journeyTutor comes with a plan

Git 03: Commits, Refs and HEAD

IaC and GitOps
IaC and GitOps · Open board

The board where “rollback = git revert” and “audit = git log” sit in one corner as if they were obvious. Both depend on what this stage builds: a commit that remembers its parent, and a name that moves.

And the chain itself:

A Chain of Snapshots
A Chain of Snapshots · Open board

The commits this stage writes, drawn as snapshots that each point back at their parent, why editing an old one renames every commit after it, and what that means for rebase against merge.

Before you start. Git 02: The Tree turned a folder into one top hash: blobs for files, trees for folders, every tree named by its contents. A tree is a snapshot with no story. This stage adds the story. You need nothing else, but the user-side view of commits and branches in Git: the ledger every change signs (commits, branches, merge and rebase) makes a good companion.

Lesson 35 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

  • 25 September 2005: HEAD is a symlink, and Linus teaches git to read a file instead
  • The commit: a tree, a past, and who said so
  • The branch: 41 bytes
  • HEAD: the pointer to the pointer
  • Real git reads it

Terms it explains: `commitAll`, Mistakes this stage invites, Forgetting the trailing newline, HEAD, IaC, merge commit, parent, rebase, ref, snapshot.

Lab

Your teammate pulled your branch yesterday. You rebase it onto main today. How many of their commits are still on it?

Leave Copy my commits on top selected, raise Commits on my branch, and watch hashes rewritten climb.

Open The rebase copy

Review From Scratch