DEV Community

Discussion on: What actually happens when you git?

Collapse
 
tbroyer profile image
Thomas Broyer

What's important I think is to understand Git stores "snapshots" of your working tree, and then computes the diffs when you need to think in terms of diffs (show me what this commit did, rebase that branch, cherry pick that commit, etc.)

Also, this storage as files named by the hashes of their content is no longer entirely accurate, as Git will actually optimize storage by "packing" things into archives (see git-scm.com/docs/git-gc which points to other plumbing commands), so you won't necessarily find the files in .git/objects (but can still access them with git cat-file)