What is the commit-graph file and what does it speed up?
AdvancedConceptGit internals: objects, refs and the index
Answer
.git/objects/info/commit-graph caches commit parents, root tree IDs and generation numbers so that log --graph, merge-base, branch --contains and reachability checks do not have to parse commit objects. Generation numbers let traversals stop early. Enable writing it on fetch and via maintenance.
git commit-graph write --reachable --changed-paths
git config fetch.writeCommitGraph true
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