Hacker News

Favorites Setup
Comment by fiddlerwoaroof | original | How big is a Git commit?
[−]fiddlerwoaroof · 2026-10-11 Sun 05:49 UTC · link
It can get even smaller when loose objects get packed into packfiles because of delta compression: a whole bunch of identical files can be stored in minimal overhead over storing one copy.
[−]bewuethr · 2026-10-11 Sun 08:15 UTC · link
I think the 250 files all containing just "foo" are stored as a single blob, too, even before creating a packfile.
[−]fiddlerwoaroof · 2026-10-11 Sun 08:53 UTC · link
I forgot about that, delta compression still can save quite a bit when you have nearly-identical files.
[−]bewuethr · 2026-10-11 Sun 09:13 UTC · link
Exactly, a tiny change in a large file produces a full new blob, but is stored very efficiently as a delta in a packfile.
[−]gblargg · 2026-10-11 Sun 09:02 UTC · link
Right, packfile size is really what matters in the long-term. A tiny change to a file in the short term just adds the whole thing again (compressed), whereas a tiny change in a packfile shouldn't add much at all. Unless you've got very limited disk space, the long-term is the only size that matters.
[−]masklinn · 2026-10-11 Sun 09:59 UTC · link
> whereas a tiny change in a packfile shouldn't add much at all

Well to the extent that git is able to find a suitable delta, which is the difficult part.