1GIT-COMMIT-GRAPH(1) Git Manual GIT-COMMIT-GRAPH(1)
2
3
4
6 git-commit-graph - Write and verify Git commit-graph files
7
9 git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]
10 git commit-graph write [--object-dir <dir>] [--append]
11 [--split[=<strategy>]] [--reachable | --stdin-packs | --stdin-commits]
12 [--changed-paths] [--[no-]max-new-filters <n>] [--[no-]progress]
13 <split options>
14
16 Manage the serialized commit-graph file.
17
19 --object-dir
20 Use given directory for the location of packfiles and commit-graph
21 file. This parameter exists to specify the location of an alternate
22 that only has the objects directory, not a full .git directory. The
23 commit-graph file is expected to be in the <dir>/info directory and
24 the packfiles are expected to be in <dir>/pack. If the directory
25 could not be made into an absolute path, or does not match any
26 known object directory, git commit-graph ... will exit with
27 non-zero status.
28
29 --[no-]progress
30 Turn progress on/off explicitly. If neither is specified, progress
31 is shown if standard error is connected to a terminal.
32
34 write
35 Write a commit-graph file based on the commits found in packfiles.
36 If the config option core.commitGraph is disabled, then this
37 command will output a warning, then return success without writing
38 a commit-graph file.
39
40 With the --stdin-packs option, generate the new commit graph by
41 walking objects only in the specified pack-indexes. (Cannot be
42 combined with --stdin-commits or --reachable.)
43
44 With the --stdin-commits option, generate the new commit graph by
45 walking commits starting at the commits specified in stdin as a
46 list of OIDs in hex, one OID per line. OIDs that resolve to
47 non-commits (either directly, or by peeling tags) are silently
48 ignored. OIDs that are malformed, or do not exist generate an
49 error. (Cannot be combined with --stdin-packs or --reachable.)
50
51 With the --reachable option, generate the new commit graph by
52 walking commits starting at all refs. (Cannot be combined with
53 --stdin-commits or --stdin-packs.)
54
55 With the --append option, include all commits that are present in
56 the existing commit-graph file.
57
58 With the --changed-paths option, compute and write information
59 about the paths changed between a commit and its first parent. This
60 operation can take a while on large repositories. It provides
61 significant performance gains for getting history of a directory or
62 a file with git log -- <path>. If this option is given, future
63 commit-graph writes will automatically assume that this option was
64 intended. Use --no-changed-paths to stop storing this data.
65
66 With the --max-new-filters=<n> option, generate at most n new Bloom
67 filters (if --changed-paths is specified). If n is -1, no limit is
68 enforced. Only commits present in the new layer count against this
69 limit. To retroactively compute Bloom filters over earlier layers,
70 it is advised to use --split=replace. Overrides the
71 commitGraph.maxNewFilters configuration.
72
73 With the --split[=<strategy>] option, write the commit-graph as a
74 chain of multiple commit-graph files stored in
75 <dir>/info/commit-graphs. Commit-graph layers are merged based on
76 the strategy and other splitting options. The new commits not
77 already in the commit-graph are added in a new "tip" file. This
78 file is merged with the existing file if the following merge
79 conditions are met:
80
81 • If --split=no-merge is specified, a merge is never performed,
82 and the remaining options are ignored. --split=replace
83 overwrites the existing chain with a new one. A bare --split
84 defers to the remaining options. (Note that merging a chain of
85 commit graphs replaces the existing chain with a length-1 chain
86 where the first and only incremental holds the entire graph).
87
88 • If --size-multiple=<X> is not specified, let X equal 2. If the
89 new tip file would have N commits and the previous tip has M
90 commits and X times N is greater than M, instead merge the two
91 files into a single file.
92
93 • If --max-commits=<M> is specified with M a positive integer,
94 and the new tip file would have more than M commits, then
95 instead merge the new tip with the previous tip.
96
97 Finally, if --expire-time=<datetime> is not specified, let
98 datetime be the current time. After writing the split
99 commit-graph, delete all unused commit-graph whose modified
100 times are older than datetime.
101
102 verify
103 Read the commit-graph file and verify its contents against the
104 object database. Used to check for corrupted data.
105
106 With the --shallow option, only check the tip commit-graph file in
107 a chain of split commit-graphs.
108
110 • Write a commit-graph file for the packed commits in your local .git
111 directory.
112
113 $ git commit-graph write
114
115 • Write a commit-graph file, extending the current commit-graph file
116 using commits in <pack-index>.
117
118 $ echo <pack-index> | git commit-graph write --stdin-packs
119
120 • Write a commit-graph file containing all reachable commits.
121
122 $ git show-ref -s | git commit-graph write --stdin-commits
123
124 • Write a commit-graph file containing all commits in the current
125 commit-graph file along with those reachable from HEAD.
126
127 $ git rev-parse HEAD | git commit-graph write --stdin-commits --append
128
130 Everything below this line in this section is selectively included from
131 the git-config(1) documentation. The content is the same as what’s
132 found there:
133
134 commitGraph.generationVersion
135 Specifies the type of generation number version to use when writing
136 or reading the commit-graph file. If version 1 is specified, then
137 the corrected commit dates will not be written or read. Defaults to
138 2.
139
140 commitGraph.maxNewFilters
141 Specifies the default value for the --max-new-filters option of git
142 commit-graph write (c.f., git-commit-graph(1)).
143
144 commitGraph.readChangedPaths
145 If true, then git will use the changed-path Bloom filters in the
146 commit-graph file (if it exists, and they are present). Defaults to
147 true. See git-commit-graph(1) for more information.
148
150 see gitformat-commit-graph(5).
151
153 Part of the git(1) suite
154
155
156
157Git 2.39.1 2023-01-13 GIT-COMMIT-GRAPH(1)