git-commit-graph
Improve Git repository commit history performance
TLDR
Write a commit-graph file for the packed commits in the repository's local .git directory
Write a commit-graph file containing all reachable commits
Write a commit-graph file containing all commits in the current commit-graph file along with those reachable from HEAD
SYNOPSIS
git commit-graph [--object-dir=
PARAMETERS
--object-dir=
Specify the object directory to read from or write to. Defaults to the standard location inside `.git`.
--alternate-refs
Include refs found in alternates when writing the commit graph. By default, refs in alternates are ignored. Required for partial clones.
DESCRIPTION
The `git commit-graph` command provides tools for creating, verifying, and modifying Git commit graphs. Commit graphs are auxiliary data structures that supplement the main Git object database, improving performance for certain Git operations, especially those involving reachability calculations and commit ancestry traversal. These are particularly beneficial in large repositories with deep or complex commit histories. The command helps in managing these graphs to optimize Git's performance. It includes subcommands for writing a commit graph from the existing object database, verifying an existing graph file, splitting an existing graph into smaller files, and re-writing the commit-graph files based on heuristics to optimize access. The use of commit graphs are transparent to most common Git commands.
CAVEATS
The commit graph format is subject to change in future Git versions. While the underlying operations remain backwards compatible, performance characteristics may vary.
COMMANDS
The `git commit-graph` command has multiple subcommands:
write: Writes a commit graph based on the objects in the object database.
verify: Verifies that a commit graph file is valid.
split: Splits an existing commit graph file into smaller files.
repack: Re-writes the commit-graph files to optimize access.
HISTORY
The `git commit-graph` command was introduced in Git 2.25.0. Its purpose is to enhance Git's performance in repositories with large and complex commit histories by providing an optimized way to access commit ancestry information. Its continued development is focused on improving performance and providing more options for managing and maintaining the commit graph data structures.
SEE ALSO
git(1), git-fsck(1), git-repack(1)