Git Internals: Objects, the .git Directory, and What a Commit Really Is
A commit is not a diff, a branch is not a folder, and .git is not a black box — it's a content-addressed key-value store with four object types. Once that clicks, git gc, shallow clones, and "detached HEAD" all stop being magic.