{
    "content": [
        {
            "type": "text",
            "text": "# git-commit-graph (man)\n\n## NAME\n\ngit-commit-graph - Write and verify Git commit-graph files\n\n## SYNOPSIS\n\ngit commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]\ngit commit-graph write <options> [--object-dir <dir>] [--[no-]progress]\n\n## DESCRIPTION\n\nManage the serialized commit-graph file.\n\n## TLDR\n\n> Write and verify Git commit-graph files.\n\n- Write a commit-graph file for the packed commits in the repository's local `.git` directory:\n  `git commit-graph write`\n- Write a commit-graph file containing all reachable commits:\n  `git show-ref {{-s|--hash}} | git commit-graph write --stdin-commits`\n- Write a commit-graph file containing all commits in the current commit-graph file along with those reachable from `HEAD`:\n  `git rev-parse {{HEAD}} | git commit-graph write --stdin-commits --append`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (1 subsections)\n- **COMMANDS**\n- **EXAMPLES**\n- **GIT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "git-commit-graph",
        "section": "",
        "mode": "man",
        "summary": "git-commit-graph - Write and verify Git commit-graph files",
        "synopsis": "git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]\ngit commit-graph write <options> [--object-dir <dir>] [--[no-]progress]",
        "tldr_summary": "Write and verify Git commit-graph files.",
        "tldr_examples": [
            {
                "description": "Write a commit-graph file for the packed commits in the repository's local `.git` directory",
                "command": "git commit-graph write"
            },
            {
                "description": "Write a commit-graph file containing all reachable commits",
                "command": "git show-ref {{-s|--hash}} | git commit-graph write --stdin-commits"
            },
            {
                "description": "Write a commit-graph file containing all commits in the current commit-graph file along with those reachable from `HEAD`",
                "command": "git rev-parse {{HEAD}} | git commit-graph write --stdin-commits --append"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "",
                "long": "--object-dir",
                "arg": null,
                "description": "Use given directory for the location of packfiles and commit-graph file. This parameter exists to specify the location of an alternate that only has the objects directory, not a full .git directory. The commit-graph file is expected to be in the <dir>/info directory and the packfiles are expected to be in <dir>/pack. If the directory could not be made into an absolute path, or does not match any known object directory, git commit-graph ... will exit with non-zero status. --[no-]progress Turn progress on/off explicitly. If neither is specified, progress is shown if standard error is connected to a terminal."
            }
        ],
        "examples": [
            "•   Write a commit-graph file for the packed commits in your local .git directory.",
            "$ git commit-graph write",
            "•   Write a commit-graph file, extending the current commit-graph file using commits in",
            "<pack-index>.",
            "$ echo <pack-index> | git commit-graph write --stdin-packs",
            "•   Write a commit-graph file containing all reachable commits.",
            "$ git show-ref -s | git commit-graph write --stdin-commits",
            "•   Write a commit-graph file containing all commits in the current commit-graph file along",
            "with those reachable from HEAD.",
            "$ git rev-parse HEAD | git commit-graph write --stdin-commits --append"
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "--object-dir",
                        "lines": 11,
                        "long": "--object-dir"
                    }
                ]
            },
            {
                "name": "COMMANDS",
                "lines": 63,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "GIT",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "git-commit-graph - Write and verify Git commit-graph files\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]\ngit commit-graph write <options> [--object-dir <dir>] [--[no-]progress]\n\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Manage the serialized commit-graph file.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "--object-dir",
                        "content": "Use given directory for the location of packfiles and commit-graph file. This parameter\nexists to specify the location of an alternate that only has the objects directory, not a\nfull .git directory. The commit-graph file is expected to be in the <dir>/info directory\nand the packfiles are expected to be in <dir>/pack. If the directory could not be made\ninto an absolute path, or does not match any known object directory, git commit-graph ...\nwill exit with non-zero status.\n\n--[no-]progress\nTurn progress on/off explicitly. If neither is specified, progress is shown if standard\nerror is connected to a terminal.\n",
                        "long": "--object-dir"
                    }
                ]
            },
            "COMMANDS": {
                "content": "write\nWrite a commit-graph file based on the commits found in packfiles. If the config option\ncore.commitGraph is disabled, then this command will output a warning, then return\nsuccess without writing a commit-graph file.\n\nWith the --stdin-packs option, generate the new commit graph by walking objects only in\nthe specified pack-indexes. (Cannot be combined with --stdin-commits or --reachable.)\n\nWith the --stdin-commits option, generate the new commit graph by walking commits\nstarting at the commits specified in stdin as a list of OIDs in hex, one OID per line.\nOIDs that resolve to non-commits (either directly, or by peeling tags) are silently\nignored. OIDs that are malformed, or do not exist generate an error. (Cannot be combined\nwith --stdin-packs or --reachable.)\n\nWith the --reachable option, generate the new commit graph by walking commits starting at\nall refs. (Cannot be combined with --stdin-commits or --stdin-packs.)\n\nWith the --append option, include all commits that are present in the existing\ncommit-graph file.\n\nWith the --changed-paths option, compute and write information about the paths changed\nbetween a commit and its first parent. This operation can take a while on large\nrepositories. It provides significant performance gains for getting history of a\ndirectory or a file with git log -- <path>. If this option is given, future commit-graph\nwrites will automatically assume that this option was intended. Use --no-changed-paths to\nstop storing this data.\n\nWith the --max-new-filters=<n> option, generate at most n new Bloom filters (if\n--changed-paths is specified). If n is -1, no limit is enforced. Only commits present in\nthe new layer count against this limit. To retroactively compute Bloom filters over\nearlier layers, it is advised to use --split=replace. Overrides the\ncommitGraph.maxNewFilters configuration.\n\nWith the --split[=<strategy>] option, write the commit-graph as a chain of multiple\ncommit-graph files stored in <dir>/info/commit-graphs. Commit-graph layers are merged\nbased on the strategy and other splitting options. The new commits not already in the\ncommit-graph are added in a new \"tip\" file. This file is merged with the existing file if\nthe following merge conditions are met:\n\n•   If --split=no-merge is specified, a merge is never performed, and the remaining\noptions are ignored.  --split=replace overwrites the existing chain with a new one. A\nbare --split defers to the remaining options. (Note that merging a chain of commit\ngraphs replaces the existing chain with a length-1 chain where the first and only\nincremental holds the entire graph).\n\n•   If --size-multiple=<X> is not specified, let X equal 2. If the new tip file would\nhave N commits and the previous tip has M commits and X times N is greater than M,\ninstead merge the two files into a single file.\n\n•   If --max-commits=<M> is specified with M a positive integer, and the new tip file\nwould have more than M commits, then instead merge the new tip with the previous tip.\n\nFinally, if --expire-time=<datetime> is not specified, let datetime be the current\ntime. After writing the split commit-graph, delete all unused commit-graph whose\nmodified times are older than datetime.\n\nverify\nRead the commit-graph file and verify its contents against the object database. Used to\ncheck for corrupted data.\n\nWith the --shallow option, only check the tip commit-graph file in a chain of split\ncommit-graphs.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "•   Write a commit-graph file for the packed commits in your local .git directory.\n\n$ git commit-graph write\n\n\n•   Write a commit-graph file, extending the current commit-graph file using commits in\n<pack-index>.\n\n$ echo <pack-index> | git commit-graph write --stdin-packs\n\n\n•   Write a commit-graph file containing all reachable commits.\n\n$ git show-ref -s | git commit-graph write --stdin-commits\n\n\n•   Write a commit-graph file containing all commits in the current commit-graph file along\nwith those reachable from HEAD.\n\n$ git rev-parse HEAD | git commit-graph write --stdin-commits --append\n\n",
                "subsections": []
            },
            "GIT": {
                "content": "Part of the git(1) suite\n\n\n\nGit 2.34.1                                   02/26/2026                          GIT-COMMIT-GRAPH(1)",
                "subsections": []
            }
        }
    }
}