Search TheCodeArtist


git gc, loose and packed git objects

Recently during lunch, a bunch of us started discussing git internals. One popular point of contention that came-up was how git stores the incremental changes internally?

The Question:
Does the .git subdirectory contain:
- compressed diffs that apply on the original version of each file?
- compressed copy of each version of each modified file?
The Answer:
Different blogs appeared to claim differently [1] [2], and we were too lazy to go look-up the definitive source - the source-code of git.

Warning: The following video is processed in a facility that also processes nuts.
 Contains traces of the 60's Batman TV show.

The Conclusion:

Another mystery solved. git gc to the rescue...


Meanwhile... having solved the riddle,
the caped-crusader and the wonder-boy went to Gotham city's garbage collection facility
in the Bat-mobile to foil whatever plan the Riddler's hatching...