What is a packed ref and why does `packed-refs` exist?
IntermediateConceptGit internals: objects, refs and the index
Answer
Thousands of tiny ref files are slow on some filesystems, so git pack-refs (run by gc) moves them into the single .git/packed-refs file. A loose ref file, when present, overrides the packed entry. Newer Git also supports the reftable backend, which stores refs in a compact binary format for large repos.
git pack-refs --all
git init --ref-format=reftable demo
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?BeginnerWhere does Git store objects on disk, and what are loose objects versus packfiles?IntermediateWhat exactly is a branch, and what does creating one cost?IntermediateWhat is HEAD?Beginner