3 ms·
> It just stores the full content of every file every time it’s modified and committed. That's not true; otherwise each git branch folder would be huge, but i
by mandeepj 4y ago
> It just stores the full content of every file every time it’s modified and committed.
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
- thro388 4y agoMaybe OP stores binary files?
- sekao 4y agoBinary files are also delta'd in git.
- _ikke_ 4y ago> 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.
- CorrectHorseBat 4y agoBranches are just pointers to commits in Git. How those commits are stored doesn't affect their size.