Git.pm: Don't require repository instance for ident
[git/dscho.git] / Documentation / git-gc.txt
blob229a7c9b30482eb2d8729b581004bc776fa10edf
1 git-gc(1)
2 =========
4 NAME
5 ----
6 git-gc - Cleanup unnecessary files and optimize the local repository
9 SYNOPSIS
10 --------
11 'git-gc' [--aggressive] [--auto] [--quiet]
13 DESCRIPTION
14 -----------
15 Runs a number of housekeeping tasks within the current repository,
16 such as compressing file revisions (to reduce disk space and increase
17 performance) and removing unreachable objects which may have been
18 created from prior invocations of linkgit:git-add[1].
20 Users are encouraged to run this task on a regular basis within
21 each repository to maintain good disk space utilization and good
22 operating performance. Some git commands may automatically run
23 `git-gc`; see the `--auto` flag below for details.
25 OPTIONS
26 -------
28 --aggressive::
29         Usually 'git-gc' runs very quickly while providing good disk
30         space utilization and performance.  This option will cause
31         git-gc to more aggressively optimize the repository at the expense
32         of taking much more time.  The effects of this optimization are
33         persistent, so this option only needs to be used occasionally; every
34         few hundred changesets or so.
36 --auto::
37         With this option, `git gc` checks whether any housekeeping is
38         required; if not, it exits without performing any work.
39         Some git commands run `git gc --auto` after performing
40         operations that could create many loose objects.
42 Housekeeping is required if there are too many loose objects or
43 too many packs in the repository. If the number of loose objects
44 exceeds the value of the `gc.auto` configuration variable, then
45 all loose objects are combined into a single pack using
46 `git-repack -d -l`.  Setting the value of `gc.auto` to 0
47 disables automatic packing of loose objects.
49 If the number of packs exceeds the value of `gc.autopacklimit`,
50 then existing packs (except those marked with a `.keep` file)
51 are consolidated into a single pack by using the `-A` option of
52 `git-repack`. Setting `gc.autopacklimit` to 0 disables
53 automatic consolidation of packs.
55 --quiet::
56         Suppress all progress reports.
58 Configuration
59 -------------
61 The optional configuration variable 'gc.reflogExpire' can be
62 set to indicate how long historical entries within each branch's
63 reflog should remain available in this repository.  The setting is
64 expressed as a length of time, for example '90 days' or '3 months'.
65 It defaults to '90 days'.
67 The optional configuration variable 'gc.reflogExpireUnreachable'
68 can be set to indicate how long historical reflog entries which
69 are not part of the current branch should remain available in
70 this repository.  These types of entries are generally created as
71 a result of using `git commit \--amend` or `git rebase` and are the
72 commits prior to the amend or rebase occurring.  Since these changes
73 are not part of the current project most users will want to expire
74 them sooner.  This option defaults to '30 days'.
76 The optional configuration variable 'gc.rerereresolved' indicates
77 how long records of conflicted merge you resolved earlier are
78 kept.  This defaults to 60 days.
80 The optional configuration variable 'gc.rerereunresolved' indicates
81 how long records of conflicted merge you have not resolved are
82 kept.  This defaults to 15 days.
84 The optional configuration variable 'gc.packrefs' determines if
85 `git gc` runs `git-pack-refs`. This can be set to "nobare" to enable
86 it within all non-bare repos or it can be set to a boolean value.
87 This defaults to true.
89 The optional configuration variable 'gc.aggressiveWindow' controls how
90 much time is spent optimizing the delta compression of the objects in
91 the repository when the --aggressive option is specified.  The larger
92 the value, the more time is spent optimizing the delta compression.  See
93 the documentation for the --window' option in linkgit:git-repack[1] for
94 more details.  This defaults to 10.
96 The optional configuration variable 'gc.pruneExpire' controls how old
97 the unreferenced loose objects have to be before they are pruned.  The
98 default is "2 weeks ago".
100 See Also
101 --------
102 linkgit:git-prune[1]
103 linkgit:git-reflog[1]
104 linkgit:git-repack[1]
105 linkgit:git-rerere[1]
107 Author
108 ------
109 Written by Shawn O. Pearce <spearce@spearce.org>
113 Part of the linkgit:git[7] suite