Theory

Updated

October 30, 2026

Theory: Content Addressing is the Whole Trick

Git is a content-addressed filesystem plus names. Internals are not trivia; they are why hosting, LFS, and fsck look the way they do.

Invariants

  1. Object name = hash of type + size + payload (SHA-1 historically, SHA-256 optional).
  2. Blobs have no filename; trees bind names to hashes.
  3. Packfiles are compression (deltas) of that object set, not the data model.
  4. A server is constrained by quarantine, receive.denyCurrentBranch, and hook timing around these objects.
commit → tree → blob
   \→ parent commit
packfile = many objects + delta chains  (disk, not mental model)

What can break

  • Editing files under .git/objects by hand.
  • Assuming SHA-1 collision is a daily concern (it is a research/hosting concern).

How to read this chapter

Object store, hashes, packfiles/git log, server-facing internals, cat-file lab.