Git is a Content-Addressable Key-Value Store
Most developers perceive Git as a tracker of file differences (deltas). In reality, Git is an elegant content-addressable storage system with a VCS interface layered on top. At the core of the .git/objects directory are four primitive object types:
- Blob: Raw file data without file names, timestamps, or directory paths.
- Tree: Represents a directory listing, mapping file names and permissions to child blob or tree hashes.
- Commit: Points to a top-level tree hash, contains author metadata, commit timestamp, commit message, and parent commit hash(es).
- Annotated Tag: A permanent reference pointing directly to a specific commit object.
The Directed Acyclic Graph (DAG)
Because each commit records the exact cryptographic hash of its parent commit, the entire history forms an immutable Directed Acyclic Graph. Commands like git branch or git tag do not copy files—they simply create lightweight 41-byte text pointers referencing a commit SHA.
# Inspect raw object contents directly
git cat-file -p HEAD
# Outputs:
# tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
# author HB <hb@hb4.space> 1727800000 +0000
# committer HB <hb@hb4.space> 1727800000 +0000
#
# feat: initialize clean edge architecture