DEV Community

Discussion on: Git saves snapshots, well not really

Collapse
 
alvarezp2000 profile image
Octavio

Yes, but that's only for "packed" files only. Packed files are used as a storage optimization only for convenient situations (like old commits, see note [1]). If Git doesn't pack (which better for speed) then it follows the native model: taking "states" or "snapshots" of your content and storing the objects without packing. The native model is still compressed, but it stores the whole object.

So: the model for content history is snapshots. The storage content is a objects (natively) with deltas (only when space-optimizing objects).

The page you are reading is specifically for packfiles. That's why it doesn't say anything, but see note [1].

The page you are looking for is this one:

You may want to read this question from Stack Overflow:

Note [1]: From the page you linked: "Git does this if you have too many loose objects around, if you run the git gc command manually, or if you push to a remote server."

Hope I helped.

Thread Thread
 
jessekphillips profile image
Jesse Phillips • Edited

Pack files are still part of git. I do understand how git stores files, which is why I mentioned pack files.

None of this helps me to understand why emphasizing git as a snapshot storage is helpful to explaining git.

(edit) I could basically say the same about svn. The content model is snapshots, it's storage is diffs and uses them to rebuild the content. But that is not helpful to using or understanding svn.