Build Your Own Git

The nearest board the site has: it follows what git does with two versions of a file once they exist. This build goes one level underneath it, to how a version is stored at all.
Before you start. This series builds a small copy of git, the tool that keeps every saved version of a folder of files. You need one idea, refreshed here: a hash is a fingerprint computed from every byte of a thing, so the same bytes always give the same fingerprint and one changed byte gives a different one (the hashing lesson draws it). If Go is new to you, Enough Go to read these builds is an optional read first. The user-side story of git, branches and merges, is Git: the ledger every change signs (commits, branches, merge and rebase); this build is the machinery under that lesson.
Code: teaching/code/from-scratch/git/. One Go module, five stages, each stage a program you can run: go run ./01-blob up to go run ./05-checkout. Each stage folder holds every file the stage before it needed plus one new file, so the last stage is the whole tool. No git library, and no call to the git program: the only place real git appears is in the proofs, where it reads what this build wrote.