Series

How Git Works

Internals, from scratch

Git is more than a version control tool — it's a content-addressable filesystem with a VCS built on top. This series opens the hood and shows you exactly how it stores data, tracks history, and recovers from mistakes.

  1. 001
    Intermediate The Object Store

    Blobs, trees, and commits — the whole repository in three shapes

    10 min
  2. 002
    Intermediate Content-Addressed Storage

    Why every object is named by the hash of its contents

    11 min
  3. 003
    Intermediate Refs, HEAD & the DAG

    Branches are text files. HEAD is a text file. That's most of Git.

    11 min
  4. 004
    Intermediate Pack Files & the Reflog

    How Git keeps a million tiny objects from melting your disk — and how it remembers every ref you've ever touched

    13 min
  5. 005
    Intermediate Rewriting History

    Amend, rebase, cherry-pick, squash — all the same primitive in disguise

    11 min
  6. 006
    Intermediate Recovering the Lost

    Reflog spelunking, fsck --lost-found, and why your "lost" commit is almost never actually lost

    12 min