1GIT-GC(1) Git Manual GIT-GC(1)
2
3
4
6 git-gc - Cleanup unnecessary files and optimize the local repository
7
9 git-gc [--prune] [--aggressive]
10
12 Runs a number of housekeeping tasks within the current repository, such
13 as compressing file revisions (to reduce disk space and increase
14 performance) and removing unreachable objects which may have been
15 created from prior invocations of git-add(1).
16
17 Users are encouraged to run this task on a regular basis within each
18 repository to maintain good disk space utilization and good operating
19 performance.
20
22 --prune
23 Usually git-gc packs refs, expires old reflog entries, packs loose
24 objects, and removes old rerere records. Removal of unreferenced
25 loose objects is an unsafe operation while other git operations are
26 in progress, so it is not done by default. Pass this option if you
27 want it, and only when you know nobody else is creating new objects
28 in the repository at the same time (e.g. never use this option in a
29 cron script).
30
31 --aggressive
32 Usually git-gc runs very quickly while providing good disk space
33 utilization and performance. This option will cause git-gc to more
34 aggressively optimize the repository at the expense of taking much
35 more time. The effects of this optimization are persistent, so this
36 option only needs to be used occasionally; every few hundred
37 changesets or so.
38
40 The optional configuration variable gc.reflogExpire can be set to
41 indicate how long historical entries within each branch´s reflog should
42 remain available in this repository. The setting is expressed as a
43 length of time, for example 90 days or 3 months. It defaults to 90
44 days.
45
46 The optional configuration variable gc.reflogExpireUnreachable can be
47 set to indicate how long historical reflog entries which are not part
48 of the current branch should remain available in this repository. These
49 types of entries are generally created as a result of using git commit
50 --amend or git rebase and are the commits prior to the amend or rebase
51 occurring. Since these changes are not part of the current project most
52 users will want to expire them sooner. This option defaults to 30 days.
53
54 The optional configuration variable gc.rerereresolved indicates how
55 long records of conflicted merge you resolved earlier are kept. This
56 defaults to 60 days.
57
58 The optional configuration variable gc.rerereunresolved indicates how
59 long records of conflicted merge you have not resolved are kept. This
60 defaults to 15 days.
61
62 The optional configuration variable gc.packrefs determines if git gc
63 runs git-pack-refs. Without the configuration, git-pack-refs is not run
64 in bare repositories by default, to allow older dumb-transport clients
65 fetch from the repository, but this will change in the future.
66
67 The optional configuration variable gc.aggressiveWindow controls how
68 much time is spent optimizing the delta compression of the objects in
69 the repository when the --aggressive option is specified. The larger
70 the value, the more time is spent optimizing the delta compression. See
71 the documentation for the --window´ option in git-repack(1) for more
72 details. This defaults to 10.
73
75 git-prune(1) git-reflog(1) git-repack(1) git-rerere(1)
76
78 Written by Shawn O. Pearce <spearce@spearce.org>
79
81 Part of the git(7) suite
82
83
84
85
86Git 1.5.3.3 10/09/2007 GIT-GC(1)