u/tugaestupidoin r/programming • Recommends
On “Do we think of git commits as diffs, snapshots, and/or histories?”
No, It's the other way around. Git does not store diffs. They have to be computed from snapshots (commits).
Commits contain a reference to a tree object. The tree object lets you know all the blobs (files) that make up that snapshot of the project (all files in your project). The blob objects contain the full contents of the files. There are never any diffs.
link to this video
In this video, they address this exact point at 32:15.