make some more strings translatable
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-gc.html.xml
blob690b856d77a4df7f76702d24b65be69d80535444
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\r
3 \r
4 <article lang="en" id="git-gc(1)">\r
5 <articleinfo>\r
6     <title>git-gc(1)</title>\r
7         <indexterm>\r
8                 <primary>git-gc(1)</primary>\r
9         </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-gc - Cleanup unnecessary files and optimize the local repository</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <simpara><emphasis>git gc</emphasis> [--aggressive] [--auto] [--quiet]</simpara>\r
18 </simplesect>\r
19 <simplesect id="_description">\r
20 <title>DESCRIPTION</title>\r
21 <simpara>Runs a number of housekeeping tasks within the current repository,\r
22 such as compressing file revisions (to reduce disk space and increase\r
23 performance) and removing unreachable objects which may have been\r
24 created from prior invocations of <emphasis>git-add</emphasis>.</simpara>\r
25 <simpara>Users are encouraged to run this task on a regular basis within\r
26 each repository to maintain good disk space utilization and good\r
27 operating performance.</simpara>\r
28 <simpara>Some git commands may automatically run <emphasis>git-gc</emphasis>; see the <literal>--auto</literal> flag\r
29 below for details. If you know what you&#8217;re doing and all you want is to\r
30 disable this behavior permanently without further considerations, just do:</simpara>\r
31 <literallayout>$ git config --global gc.auto 0</literallayout>\r
32 </simplesect>\r
33 <simplesect id="_options">\r
34 <title>OPTIONS</title>\r
35 <variablelist>\r
36 <varlistentry>\r
37 <term>\r
38 --aggressive\r
39 </term>\r
40 <listitem>\r
41 <simpara>\r
42         Usually <emphasis>git-gc</emphasis> runs very quickly while providing good disk\r
43         space utilization and performance.  This option will cause\r
44         <emphasis>git-gc</emphasis> to more aggressively optimize the repository at the expense\r
45         of taking much more time.  The effects of this optimization are\r
46         persistent, so this option only needs to be used occasionally; every\r
47         few hundred changesets or so.\r
48 </simpara>\r
49 </listitem>\r
50 </varlistentry>\r
51 <varlistentry>\r
52 <term>\r
53 --auto\r
54 </term>\r
55 <listitem>\r
56 <simpara>\r
57         With this option, <emphasis>git-gc</emphasis> checks whether any housekeeping is\r
58         required; if not, it exits without performing any work.\r
59         Some git commands run <literal>git gc --auto</literal> after performing\r
60         operations that could create many loose objects.\r
61 </simpara>\r
62 <simpara>Housekeeping is required if there are too many loose objects or\r
63 too many packs in the repository. If the number of loose objects\r
64 exceeds the value of the <literal>gc.auto</literal> configuration variable, then\r
65 all loose objects are combined into a single pack using\r
66 <emphasis>git-repack -d -l</emphasis>.  Setting the value of <literal>gc.auto</literal> to 0\r
67 disables automatic packing of loose objects.</simpara>\r
68 <simpara>If the number of packs exceeds the value of <literal>gc.autopacklimit</literal>,\r
69 then existing packs (except those marked with a <literal>.keep</literal> file)\r
70 are consolidated into a single pack by using the <literal>-A</literal> option of\r
71 <emphasis>git-repack</emphasis>. Setting <literal>gc.autopacklimit</literal> to 0 disables\r
72 automatic consolidation of packs.</simpara>\r
73 </listitem>\r
74 </varlistentry>\r
75 <varlistentry>\r
76 <term>\r
77 --quiet\r
78 </term>\r
79 <listitem>\r
80 <simpara>\r
81         Suppress all progress reports.\r
82 </simpara>\r
83 </listitem>\r
84 </varlistentry>\r
85 </variablelist>\r
86 </simplesect>\r
87 <simplesect id="_configuration">\r
88 <title>Configuration</title>\r
89 <simpara>The optional configuration variable <emphasis>gc.reflogExpire</emphasis> can be\r
90 set to indicate how long historical entries within each branch&#8217;s\r
91 reflog should remain available in this repository.  The setting is\r
92 expressed as a length of time, for example <emphasis>90 days</emphasis> or <emphasis>3 months</emphasis>.\r
93 It defaults to <emphasis>90 days</emphasis>.</simpara>\r
94 <simpara>The optional configuration variable <emphasis>gc.reflogExpireUnreachable</emphasis>\r
95 can be set to indicate how long historical reflog entries which\r
96 are not part of the current branch should remain available in\r
97 this repository.  These types of entries are generally created as\r
98 a result of using <literal>git commit --amend</literal> or <literal>git rebase</literal> and are the\r
99 commits prior to the amend or rebase occurring.  Since these changes\r
100 are not part of the current project most users will want to expire\r
101 them sooner.  This option defaults to <emphasis>30 days</emphasis>.</simpara>\r
102 <simpara>The optional configuration variable <emphasis>gc.rerereresolved</emphasis> indicates\r
103 how long records of conflicted merge you resolved earlier are\r
104 kept.  This defaults to 60 days.</simpara>\r
105 <simpara>The optional configuration variable <emphasis>gc.rerereunresolved</emphasis> indicates\r
106 how long records of conflicted merge you have not resolved are\r
107 kept.  This defaults to 15 days.</simpara>\r
108 <simpara>The optional configuration variable <emphasis>gc.packrefs</emphasis> determines if\r
109 <emphasis>git-gc</emphasis> runs <emphasis>git-pack-refs</emphasis>. This can be set to "nobare" to enable\r
110 it within all non-bare repos or it can be set to a boolean value.\r
111 This defaults to true.</simpara>\r
112 <simpara>The optional configuration variable <emphasis>gc.aggressiveWindow</emphasis> controls how\r
113 much time is spent optimizing the delta compression of the objects in\r
114 the repository when the --aggressive option is specified.  The larger\r
115 the value, the more time is spent optimizing the delta compression.  See\r
116 the documentation for the --window' option in <xref linkend="git-repack(1)"/> for\r
117 more details.  This defaults to 10.</simpara>\r
118 <simpara>The optional configuration variable <emphasis>gc.pruneExpire</emphasis> controls how old\r
119 the unreferenced loose objects have to be before they are pruned.  The\r
120 default is "2 weeks ago".</simpara>\r
121 </simplesect>\r
122 <simplesect id="_notes">\r
123 <title>Notes</title>\r
124 <simpara><emphasis>git-gc</emphasis> tries very hard to be safe about the garbage it collects. In\r
125 particular, it will keep not only objects referenced by your current set\r
126 of branches and tags, but also objects referenced by the index, remote\r
127 tracking branches, refs saved by <emphasis>git-filter-branch</emphasis> in\r
128 refs/original/, or reflogs (which may references commits in branches\r
129 that were later amended or rewound).</simpara>\r
130 <simpara>If you are expecting some objects to be collected and they aren&#8217;t, check\r
131 all of those locations and decide whether it makes sense in your case to\r
132 remove those references.</simpara>\r
133 </simplesect>\r
134 <simplesect id="_see_also">\r
135 <title>SEE ALSO</title>\r
136 <simpara><xref linkend="git-prune(1)"/>\r
137 <xref linkend="git-reflog(1)"/>\r
138 <xref linkend="git-repack(1)"/>\r
139 <xref linkend="git-rerere(1)"/></simpara>\r
140 </simplesect>\r
141 <simplesect id="_author">\r
142 <title>Author</title>\r
143 <simpara>Written by Shawn O. Pearce &lt;<ulink url="mailto:spearce@spearce.org">spearce@spearce.org</ulink>&gt;</simpara>\r
144 </simplesect>\r
145 <simplesect id="_git">\r
146 <title>GIT</title>\r
147 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>\r
148 </simplesect>\r
149 </article>\r