kb/objects
The Git object model has four object types, with SHA-1 as the key to each. What lives in `.git/objects/`, why Git is a key-value store, how `git add` creates a blob, and how `git commit` builds a tree. This is the most important chapter for understanding everything else.
A Git object that stores the content of a single file. Just bytes, no name, no permissions, no date. The filename lives in the `tree`, not in the blob.
A Git object: a snapshot of the entire project (via a tree) plus metadata including author, committer, date, parents, and message. The SHA of a commit includes the parent's SHA, which makes history cryptographically linked.
A compressed file in `.git/objects/pack/` where Git packs many loose objects to save space and speed up network operations. Uses delta compression between similar objects.
The 40-character hash Git uses to address objects. Computed from content with a type prefix. Broken cryptographically in 2017 (SHAttered), but still the default in Git as migration to SHA-256 moves slowly.
A named pointer to a commit. Two kinds: lightweight (a file with a SHA in `refs/tags/`) and annotated (a separate object in `objects/` with author, date, and optional signature). For releases, use annotated.
A Git object that holds the listing of one directory: entries of the form `(mode, type, SHA, name)`. It references other tree objects recursively for subdirectories.