Re:Git’s database internals I: packed object store
by _ikke_ on Monday August 29, 2022 @11:01AM
(#32639127)
> It stores the snapshot of changes in branch folders
No, gp is right. There is no snapshot of changes. Each unique version of a file is an object in the object store. That does mean each commit would only introduce new objects for files that have changed (these are already added to the object store when you use `git add`) .
But the pack files like the article explains (which are created regularly during gc/maintenance runs) is why the repo size can often be smaller then the working tree.
> Not only is each object compressed individually, they can also be compressed against each other to take advantage of common data.
Re:Git’s database internals I: packed object store
by CorrectHorseBat on Monday August 29, 2022 @12:13PM
(#32639942)
Branches are just pointers to commits in Git. How those commits are stored doesn't affect their size.
That's not true; otherwise each git branch folder would be huge, but it's not. It stores the snapshot of changes in branch folders