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 02: The Tree

What Git Actually Ships
What Git Actually Ships · Open board

The nearest board the site has: git’s diff machinery, which compares two versions of a file. Every comparison it draws starts from the thing this stage builds, a version stored as a tree of fingerprints.

Before you start. Git 01: The Blob built the blob: a file’s bytes, named by the hash of a header plus those bytes, stored zlib-compressed under .git/objects. A blob has no file name and no folder. This stage supplies both. You need no new idea, only the one from last time: an object’s name is a fingerprint of its contents.

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

  • 5 September 1979: one hash that vouches for many things
  • A folder is a list: mode, name, fingerprint
  • The strange part: how the entry is stored
  • The sort rule with a trap in it
  • One top hash for the whole project: the Merkle property
  • Two small decisions
  • Real git agrees

Terms it explains: tree, mode, name, 20 raw bytes, Decoding, Snapshot, Mistakes this stage invites.

Review From Scratch