@@ -15,8 +15,9 @@ DESCRIPTION
15
15
-----------
16
16
Runs a number of housekeeping tasks within the current repository,
17
17
such as compressing file revisions (to reduce disk space and increase
18
- performance) and removing unreachable objects which may have been
19
- created from prior invocations of 'git add'.
18
+ performance), removing unreachable objects which may have been
19
+ created from prior invocations of 'git add', packing refs, pruning
20
+ reflog, rerere metadata or stale working trees.
20
21
21
22
Users are encouraged to run this task on a regular basis within
22
23
each repository to maintain good disk space utilization and good
@@ -45,20 +46,25 @@ OPTIONS
45
46
With this option, 'git gc' checks whether any housekeeping is
46
47
required; if not, it exits without performing any work.
47
48
Some git commands run `git gc --auto` after performing
48
- operations that could create many loose objects.
49
+ operations that could create many loose objects. Housekeeping
50
+ is required if there are too many loose objects or too many
51
+ packs in the repository.
49
52
+
50
- Housekeeping is required if there are too many loose objects or
51
- too many packs in the repository. If the number of loose objects
52
- exceeds the value of the `gc.auto` configuration variable, then
53
- all loose objects are combined into a single pack using
54
- `git repack -d -l`. Setting the value of `gc.auto` to 0
55
- disables automatic packing of loose objects.
53
+ If the number of loose objects exceeds the value of the `gc.auto`
54
+ configuration variable, then all loose objects are combined into a
55
+ single pack using `git repack -d -l`. Setting the value of `gc.auto`
56
+ to 0 disables automatic packing of loose objects.
56
57
+
57
58
If the number of packs exceeds the value of `gc.autoPackLimit`,
58
59
then existing packs (except those marked with a `.keep` file)
59
60
are consolidated into a single pack by using the `-A` option of
60
61
'git repack'. Setting `gc.autoPackLimit` to 0 disables
61
62
automatic consolidation of packs.
63
+ +
64
+ If houskeeping is required due to many loose objects or packs, all
65
+ other housekeeping tasks (e.g. rerere, working trees, reflog...) will
66
+ be performed as well.
67
+
62
68
63
69
--prune=<date>::
64
70
Prune loose objects older than date (default is 2 weeks ago,
@@ -133,6 +139,10 @@ The optional configuration variable `gc.pruneExpire` controls how old
133
139
the unreferenced loose objects have to be before they are pruned. The
134
140
default is "2 weeks ago".
135
141
142
+ Optional configuration variable `gc.worktreePruneExpire` controls how
143
+ old a stale working tree should be before `git worktree prune` deletes
144
+ it. Default is "3 months ago".
145
+
136
146
137
147
Notes
138
148
-----
0 commit comments