]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/config/gc.txt
The second batch
[thirdparty/git.git] / Documentation / config / gc.txt
CommitLineData
8daf3271
NTND
1gc.aggressiveDepth::
2 The depth parameter used in the delta compression
3 algorithm used by 'git gc --aggressive'. This defaults
080a4480
ÆAB
4 to 50, which is the default for the `--depth` option when
5 `--aggressive` isn't in use.
b6a8d09f
ÆAB
6+
7See the documentation for the `--depth` option in
8linkgit:git-repack[1] for more details.
8daf3271
NTND
9
10gc.aggressiveWindow::
11 The window size parameter used in the delta compression
12 algorithm used by 'git gc --aggressive'. This defaults
080a4480
ÆAB
13 to 250, which is a much more aggressive window size than
14 the default `--window` of 10.
b6a8d09f
ÆAB
15+
16See the documentation for the `--window` option in
17linkgit:git-repack[1] for more details.
8daf3271
NTND
18
19gc.auto::
20 When there are approximately more than this many loose
21 objects in the repository, `git gc --auto` will pack them.
22 Some Porcelain commands use this command to perform a
23 light-weight garbage collection from time to time. The
b6a8d09f
ÆAB
24 default value is 6700.
25+
26Setting this to 0 disables not only automatic packing based on the
cf6cac20 27number of loose objects, but also any other heuristic `git gc --auto` will
b6a8d09f
ÆAB
28otherwise use to determine if there's work to do, such as
29`gc.autoPackLimit`.
8daf3271
NTND
30
31gc.autoPackLimit::
32 When there are more than this many packs that are not
33 marked with `*.keep` file in the repository, `git gc
34 --auto` consolidates them into one larger pack. The
8d75a1d1 35 default value is 50. Setting this to 0 disables it.
b6a8d09f
ÆAB
36 Setting `gc.auto` to 0 will also disable this.
37+
38See the `gc.bigPackThreshold` configuration variable below. When in
39use, it'll affect how the auto pack limit works.
8daf3271
NTND
40
41gc.autoDetach::
0a4f051f 42 Make `git gc --auto` return immediately and run in the background
8daf3271
NTND
43 if the system supports it. Default is true.
44
45gc.bigPackThreshold::
05b9013b
TB
46 If non-zero, all non-cruft packs larger than this limit are kept
47 when `git gc` is run. This is very similar to
48 `--keep-largest-pack` except that all non-cruft packs that meet
49 the threshold are kept, not just the largest pack. Defaults to
50 zero. Common unit suffixes of 'k', 'm', or 'g' are supported.
8daf3271
NTND
51+
52Note that if the number of kept packs is more than gc.autoPackLimit,
53this configuration variable is ignored, all packs except the base pack
54will be repacked. After this the number of packs should go below
55gc.autoPackLimit and gc.bigPackThreshold should be respected again.
b6a8d09f
ÆAB
56+
57If the amount of memory estimated for `git repack` to run smoothly is
d257e0fb
ÆAB
58not available and `gc.bigPackThreshold` is not set, the largest pack
59will also be excluded (this is the equivalent of running `git gc` with
db5368b8 60`--keep-largest-pack`).
8daf3271
NTND
61
62gc.writeCommitGraph::
63 If true, then gc will rewrite the commit-graph file when
54d56f52
ÆAB
64 linkgit:git-gc[1] is run. When using `git gc --auto`
65 the commit-graph will be updated if housekeeping is
31b1de6a 66 required. Default is true. See linkgit:git-commit-graph[1]
8daf3271
NTND
67 for details.
68
69gc.logExpiry::
70 If the file gc.log exists, then `git gc --auto` will print
71 its content and exit with status zero instead of running
72 unless that file is more than 'gc.logExpiry' old. Default is
73 "1.day". See `gc.pruneExpire` for more ways to specify its
74 value.
75
76gc.packRefs::
77 Running `git pack-refs` in a repository renders it
78 unclonable by Git versions prior to 1.5.1.2 over dumb
79 transports such as HTTP. This variable determines whether
80 'git gc' runs `git pack-refs`. This can be set to `notbare`
81 to enable it within all non-bare repos or it can be set to a
82 boolean value. The default is `true`.
83
5b92477f
TB
84gc.cruftPacks::
85 Store unreachable objects in a cruft pack (see
86 linkgit:git-repack[1]) instead of as loose objects. The default
e3e24de1 87 is `true`.
5b92477f 88
37dc6d81
TB
89gc.maxCruftSize::
90 Limit the size of new cruft packs when repacking. When
91 specified in addition to `--max-cruft-size`, the command line
92 option takes priority. See the `--max-cruft-size` option of
93 linkgit:git-repack[1].
94
8daf3271 95gc.pruneExpire::
5b92477f
TB
96 When 'git gc' is run, it will call 'prune --expire 2.weeks.ago'
97 (and 'repack --cruft --cruft-expiration 2.weeks.ago' if using
98 cruft packs via `gc.cruftPacks` or `--cruft`). Override the
99 grace period with this config variable. The value "now" may be
100 used to disable this grace period and always prune unreachable
101 objects immediately, or "never" may be used to suppress pruning.
102 This feature helps prevent corruption when 'git gc' runs
103 concurrently with another process writing to the repository; see
104 the "NOTES" section of linkgit:git-gc[1].
8daf3271
NTND
105
106gc.worktreePruneExpire::
107 When 'git gc' is run, it calls
108 'git worktree prune --expire 3.months.ago'.
109 This config variable can be used to set a different grace
110 period. The value "now" may be used to disable the grace
111 period and prune `$GIT_DIR/worktrees` immediately, or "never"
112 may be used to suppress pruning.
113
114gc.reflogExpire::
115gc.<pattern>.reflogExpire::
116 'git reflog expire' removes reflog entries older than
117 this time; defaults to 90 days. The value "now" expires all
118 entries immediately, and "never" suppresses expiration
119 altogether. With "<pattern>" (e.g.
120 "refs/stash") in the middle the setting applies only to
121 the refs that match the <pattern>.
122
123gc.reflogExpireUnreachable::
124gc.<pattern>.reflogExpireUnreachable::
125 'git reflog expire' removes reflog entries older than
126 this time and are not reachable from the current tip;
127 defaults to 30 days. The value "now" expires all entries
128 immediately, and "never" suppresses expiration altogether.
129 With "<pattern>" (e.g. "refs/stash")
130 in the middle, the setting applies only to the refs that
131 match the <pattern>.
b6a8d09f 132+
d257e0fb
ÆAB
133These types of entries are generally created as a result of using `git
134commit --amend` or `git rebase` and are the commits prior to the amend
135or rebase occurring. Since these changes are not part of the current
136project most users will want to expire them sooner, which is why the
137default is more aggressive than `gc.reflogExpire`.
8daf3271 138
4dc16e2c
TB
139gc.recentObjectsHook::
140 When considering whether or not to remove an object (either when
141 generating a cruft pack or storing unreachable objects as
142 loose), use the shell to execute the specified command(s).
143 Interpret their output as object IDs which Git will consider as
144 "recent", regardless of their age. By treating their mtimes as
145 "now", any objects (and their descendants) mentioned in the
146 output will be kept regardless of their true age.
147+
148Output must contain exactly one hex object ID per line, and nothing
149else. Objects which cannot be found in the repository are ignored.
150Multiple hooks are supported, but all must exit successfully, else the
151operation (either generating a cruft pack or unpacking unreachable
152objects) will be halted.
153
1cd43a9e
CC
154gc.repackFilter::
155 When repacking, use the specified filter to move certain
156 objects into a separate packfile. See the
157 `--filter=<filter-spec>` option of linkgit:git-repack[1].
158
9b96046b
CC
159gc.repackFilterTo::
160 When repacking and using a filter, see `gc.repackFilter`, the
161 specified location will be used to create the packfile
162 containing the filtered out objects. **WARNING:** The
163 specified location should be accessible, using for example the
164 Git alternates mechanism, otherwise the repo could be
165 considered corrupt by Git as it migh not be able to access the
166 objects in that packfile. See the `--filter-to=<dir>` option
167 of linkgit:git-repack[1] and the `objects/info/alternates`
168 section of linkgit:gitrepository-layout[5].
169
8daf3271
NTND
170gc.rerereResolved::
171 Records of conflicted merge you resolved earlier are
172 kept for this many days when 'git rerere gc' is run.
173 You can also use more human-readable "1.month.ago", etc.
174 The default is 60 days. See linkgit:git-rerere[1].
175
176gc.rerereUnresolved::
177 Records of conflicted merge you have not resolved are
178 kept for this many days when 'git rerere gc' is run.
179 You can also use more human-readable "1.month.ago", etc.
180 The default is 15 days. See linkgit:git-rerere[1].