Massive log/walk speedup. Modern repos all want this.
git commit-graph builds and maintains the commit-graph file — an auxiliary index of commit metadata that makes git log, --graph, reachability queries, and ancestry checks dramatically faster on large repos.
A cache file at .git/objects/info/commit-graph (or under commit-graphs/ when split). It stores parent pointers, commit times, generation numbers, and optionally changed-path Bloom filters — all derived from existing commit objects. Refs and the object DB are unchanged; this is pure read-side acceleration. Auto-written by git maintenance and gc.writeCommitGraph=true.
git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]
git commit-graph write [--object-dir <dir>] [--append|--split[=<strategy>]]
[--reachable | --stdin-packs | --stdin-commits]
[--changed-paths] [--max-new-filters=<n>] [--[no-]progress]| Flag | What it does |
|---|---|
--reachable | Walk every ref to discover commits. Most common; produces a full graph. |
--stdin-packs | Read pack-index filenames from stdin and include only commits in those packs. |
--stdin-commits | Read commit OIDs from stdin and include only those (and optionally their ancestors). |
--changed-paths | Also compute Bloom filters of changed file paths — speeds up git log -- <path> enormously. |
--split[=<strategy>] | Write an incremental layered graph instead of one monolithic file. Strategies: no-merge, replace. |
--append | Append new commits to the existing graph rather than rewriting from scratch. |
--object-dir <dir> | Operate on the graph in <dir>/info/ instead of the default object directory. |
git commit-graph verifygit commit-graph write --reachable --changed-pathsgit commit-graph readgit log --graph --oneline on repos with hundreds of thousands of commits.git log -- some/file) usable on monorepos via --changed-paths.verify.--split so writes stay incremental.git commit-graph write --reachablegit commit-graph write --reachable --changed-pathsgit commit-graph write --reachable --splitgit commit-graph verifygit config --global maintenance.commit-graph.enabled true and run git maintenance start — let Git keep the graph current for you.--changed-paths when your workflow involves heavy git log -- <path> queries.--split on very large repos so daily updates do not rewrite a multi-hundred-MB file each time.git log results — verify is your friend after crashes.--changed-paths only accelerate queries when the graph was written with them; mixing graphs with/without them is a common puzzle.write leaves the graph referencing dropped commits until next refresh.Hit each option, then Check answers. Score is recorded; Next is always open.