Where does Git store objects on disk, and what are loose objects versus packfiles?
IntermediateConceptGit internals: objects, refs and the index
Answer
Under .git/objects. A loose object is one zlib-compressed file at objects/ab/cdef... named by its ID. When objects pile up, git gc (or git repack) bundles them into objects/pack/*.pack with an .idx index, using delta compression between similar objects. Fetch and push also transfer packfiles.
git count-objects -vH
ls .git/objects/pack
More on Git internals: objects, refs and the index
What are the four object types in Git's object database?BeginnerIs Git a snapshot system or a diff system?BeginnerWhat is the SHA-1 (or SHA-256) hash of an object and how is it computed?BeginnerWhat exactly is a branch, and what does creating one cost?IntermediateWhat is HEAD?BeginnerWhat is a detached HEAD and how do you recover work done in it?Intermediate