updated git doc
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-pack-objects.xml
blobe30f5dccd1ebd9d3bca8e049217f0e1494545f47
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">\r
3 \r
4 <article lang="en" id="git-pack-objects(1)">\r
5 <articleinfo>\r
6     <title>git-pack-objects(1)</title>\r
7 <indexterm>\r
8 <primary>git-pack-objects(1)</primary>\r
9 </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-pack-objects - Create a packed archive of objects</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <blockquote>\r
18 <literallayout><emphasis>git pack-objects</emphasis> [-q | --progress | --all-progress] [--all-progress-implied]\r
19         [--no-reuse-delta] [--delta-base-offset] [--non-empty]\r
20         [--local] [--incremental] [--window=&lt;n&gt;] [--depth=&lt;n&gt;]\r
21         [--revs [--unpacked | --all]] [--stdout | base-name]\r
22         [--keep-true-parents] &lt; object-list</literallayout>\r
23 </blockquote>\r
24 </simplesect>\r
25 <simplesect id="_description">\r
26 <title>DESCRIPTION</title>\r
27 <simpara>Reads list of objects from the standard input, and writes a packed\r
28 archive with specified base-name, or to the standard output.</simpara>\r
29 <simpara>A packed archive is an efficient way to transfer a set of objects\r
30 between two repositories as well as an access efficient archival\r
31 format.  In a packed archive, an object is either stored as a\r
32 compressed whole or as a difference from some other object.\r
33 The latter is often called a delta.</simpara>\r
34 <simpara>The packed archive format (.pack) is designed to be self-contained\r
35 so that it can be unpacked without any further information. Therefore,\r
36 each object that a delta depends upon must be present within the pack.</simpara>\r
37 <simpara>A pack index file (.idx) is generated for fast, random access to the\r
38 objects in the pack. Placing both the index file (.idx) and the packed\r
39 archive (.pack) in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or\r
40 any of the directories on $GIT_ALTERNATE_OBJECT_DIRECTORIES)\r
41 enables git to read from the pack archive.</simpara>\r
42 <simpara>The <emphasis>git unpack-objects</emphasis> command can read the packed archive and\r
43 expand the objects contained in the pack into "one-file\r
44 one-object" format; this is typically done by the smart-pull\r
45 commands when a pack is created on-the-fly for efficient network\r
46 transport by their peers.</simpara>\r
47 </simplesect>\r
48 <simplesect id="_options">\r
49 <title>OPTIONS</title>\r
50 <variablelist>\r
51 <varlistentry>\r
52 <term>\r
53 base-name\r
54 </term>\r
55 <listitem>\r
56 <simpara>\r
57         Write into a pair of files (.pack and .idx), using\r
58         &lt;base-name&gt; to determine the name of the created file.\r
59         When this option is used, the two files are written in\r
60         &lt;base-name&gt;-&lt;SHA1&gt;.{pack,idx} files.  &lt;SHA1&gt; is a hash\r
61         of the sorted object names to make the resulting filename\r
62         based on the pack content, and written to the standard\r
63         output of the command.\r
64 </simpara>\r
65 </listitem>\r
66 </varlistentry>\r
67 <varlistentry>\r
68 <term>\r
69 --stdout\r
70 </term>\r
71 <listitem>\r
72 <simpara>\r
73         Write the pack contents (what would have been written to\r
74         .pack file) out to the standard output.\r
75 </simpara>\r
76 </listitem>\r
77 </varlistentry>\r
78 <varlistentry>\r
79 <term>\r
80 --revs\r
81 </term>\r
82 <listitem>\r
83 <simpara>\r
84         Read the revision arguments from the standard input, instead of\r
85         individual object names.  The revision arguments are processed\r
86         the same way as <emphasis>git rev-list</emphasis> with the <emphasis>--objects</emphasis> flag\r
87         uses its <emphasis>commit</emphasis> arguments to build the list of objects it\r
88         outputs.  The objects on the resulting list are packed.\r
89 </simpara>\r
90 </listitem>\r
91 </varlistentry>\r
92 <varlistentry>\r
93 <term>\r
94 --unpacked\r
95 </term>\r
96 <listitem>\r
97 <simpara>\r
98         This implies <emphasis>--revs</emphasis>.  When processing the list of\r
99         revision arguments read from the standard input, limit\r
100         the objects packed to those that are not already packed.\r
101 </simpara>\r
102 </listitem>\r
103 </varlistentry>\r
104 <varlistentry>\r
105 <term>\r
106 --all\r
107 </term>\r
108 <listitem>\r
109 <simpara>\r
110         This implies <emphasis>--revs</emphasis>.  In addition to the list of\r
111         revision arguments read from the standard input, pretend\r
112         as if all refs under <emphasis>refs/</emphasis> are specified to be\r
113         included.\r
114 </simpara>\r
115 </listitem>\r
116 </varlistentry>\r
117 <varlistentry>\r
118 <term>\r
119 --include-tag\r
120 </term>\r
121 <listitem>\r
122 <simpara>\r
123         Include unasked-for annotated tags if the object they\r
124         reference was included in the resulting packfile.  This\r
125         can be useful to send new tags to native git clients.\r
126 </simpara>\r
127 </listitem>\r
128 </varlistentry>\r
129 <varlistentry>\r
130 <term>\r
131 --window=&lt;n&gt;\r
132 </term>\r
133 <term>\r
134 --depth=&lt;n&gt;\r
135 </term>\r
136 <listitem>\r
137 <simpara>\r
138         These two options affect how the objects contained in\r
139         the pack are stored using delta compression.  The\r
140         objects are first internally sorted by type, size and\r
141         optionally names and compared against the other objects\r
142         within --window to see if using delta compression saves\r
143         space.  --depth limits the maximum delta depth; making\r
144         it too deep affects the performance on the unpacker\r
145         side, because delta data needs to be applied that many\r
146         times to get to the necessary object.\r
147         The default value for --window is 10 and --depth is 50.\r
148 </simpara>\r
149 </listitem>\r
150 </varlistentry>\r
151 <varlistentry>\r
152 <term>\r
153 --window-memory=&lt;n&gt;\r
154 </term>\r
155 <listitem>\r
156 <simpara>\r
157         This option provides an additional limit on top of <emphasis>--window</emphasis>;\r
158         the window size will dynamically scale down so as to not take\r
159         up more than <emphasis>&lt;n&gt;</emphasis> bytes in memory.  This is useful in\r
160         repositories with a mix of large and small objects to not run\r
161         out of memory with a large window, but still be able to take\r
162         advantage of the large window for the smaller objects.  The\r
163         size can be suffixed with "k", "m", or "g".\r
164         <emphasis>--window-memory=0</emphasis> makes memory usage unlimited, which is the\r
165         default.\r
166 </simpara>\r
167 </listitem>\r
168 </varlistentry>\r
169 <varlistentry>\r
170 <term>\r
171 --max-pack-size=&lt;n&gt;\r
172 </term>\r
173 <listitem>\r
174 <simpara>\r
175         Maximum size of each output pack file. The size can be suffixed with\r
176         "k", "m", or "g". The minimum size allowed is limited to 1 MiB.\r
177         If specified,  multiple packfiles may be created.\r
178         The default is unlimited, unless the config variable\r
179         <emphasis>pack.packSizeLimit</emphasis> is set.\r
180 </simpara>\r
181 </listitem>\r
182 </varlistentry>\r
183 <varlistentry>\r
184 <term>\r
185 --honor-pack-keep\r
186 </term>\r
187 <listitem>\r
188 <simpara>\r
189         This flag causes an object already in a local pack that\r
190         has a .keep file to be ignored, even if it would have\r
191         otherwise been packed.\r
192 </simpara>\r
193 </listitem>\r
194 </varlistentry>\r
195 <varlistentry>\r
196 <term>\r
197 --incremental\r
198 </term>\r
199 <listitem>\r
200 <simpara>\r
201         This flag causes an object already in a pack to be ignored\r
202         even if it would have otherwise been packed.\r
203 </simpara>\r
204 </listitem>\r
205 </varlistentry>\r
206 <varlistentry>\r
207 <term>\r
208 --local\r
209 </term>\r
210 <listitem>\r
211 <simpara>\r
212         This flag causes an object that is borrowed from an alternate\r
213         object store to be ignored even if it would have otherwise been\r
214         packed.\r
215 </simpara>\r
216 </listitem>\r
217 </varlistentry>\r
218 <varlistentry>\r
219 <term>\r
220 --non-empty\r
221 </term>\r
222 <listitem>\r
223 <simpara>\r
224         Only create a packed archive if it would contain at\r
225         least one object.\r
226 </simpara>\r
227 </listitem>\r
228 </varlistentry>\r
229 <varlistentry>\r
230 <term>\r
231 --progress\r
232 </term>\r
233 <listitem>\r
234 <simpara>\r
235         Progress status is reported on the standard error stream\r
236         by default when it is attached to a terminal, unless -q\r
237         is specified. This flag forces progress status even if\r
238         the standard error stream is not directed to a terminal.\r
239 </simpara>\r
240 </listitem>\r
241 </varlistentry>\r
242 <varlistentry>\r
243 <term>\r
244 --all-progress\r
245 </term>\r
246 <listitem>\r
247 <simpara>\r
248         When --stdout is specified then progress report is\r
249         displayed during the object count and compression phases\r
250         but inhibited during the write-out phase. The reason is\r
251         that in some cases the output stream is directly linked\r
252         to another command which may wish to display progress\r
253         status of its own as it processes incoming pack data.\r
254         This flag is like --progress except that it forces progress\r
255         report for the write-out phase as well even if --stdout is\r
256         used.\r
257 </simpara>\r
258 </listitem>\r
259 </varlistentry>\r
260 <varlistentry>\r
261 <term>\r
262 --all-progress-implied\r
263 </term>\r
264 <listitem>\r
265 <simpara>\r
266         This is used to imply --all-progress whenever progress display\r
267         is activated.  Unlike --all-progress this flag doesn't actually\r
268         force any progress display by itself.\r
269 </simpara>\r
270 </listitem>\r
271 </varlistentry>\r
272 <varlistentry>\r
273 <term>\r
274 -q\r
275 </term>\r
276 <listitem>\r
277 <simpara>\r
278         This flag makes the command not to report its progress\r
279         on the standard error stream.\r
280 </simpara>\r
281 </listitem>\r
282 </varlistentry>\r
283 <varlistentry>\r
284 <term>\r
285 --no-reuse-delta\r
286 </term>\r
287 <listitem>\r
288 <simpara>\r
289         When creating a packed archive in a repository that\r
290         has existing packs, the command reuses existing deltas.\r
291         This sometimes results in a slightly suboptimal pack.\r
292         This flag tells the command not to reuse existing deltas\r
293         but compute them from scratch.\r
294 </simpara>\r
295 </listitem>\r
296 </varlistentry>\r
297 <varlistentry>\r
298 <term>\r
299 --no-reuse-object\r
300 </term>\r
301 <listitem>\r
302 <simpara>\r
303         This flag tells the command not to reuse existing object data at all,\r
304         including non deltified object, forcing recompression of everything.\r
305         This implies --no-reuse-delta. Useful only in the obscure case where\r
306         wholesale enforcement of a different compression level on the\r
307         packed data is desired.\r
308 </simpara>\r
309 </listitem>\r
310 </varlistentry>\r
311 <varlistentry>\r
312 <term>\r
313 --compression=&lt;n&gt;\r
314 </term>\r
315 <listitem>\r
316 <simpara>\r
317         Specifies compression level for newly-compressed data in the\r
318         generated pack.  If not specified,  pack compression level is\r
319         determined first by pack.compression,  then by core.compression,\r
320         and defaults to -1,  the zlib default,  if neither is set.\r
321         Add --no-reuse-object if you want to force a uniform compression\r
322         level on all data no matter the source.\r
323 </simpara>\r
324 </listitem>\r
325 </varlistentry>\r
326 <varlistentry>\r
327 <term>\r
328 --thin\r
329 </term>\r
330 <listitem>\r
331 <simpara>\r
332         Create a "thin" pack by omitting the common objects between a\r
333         sender and a receiver in order to reduce network transfer. This\r
334         option only makes sense in conjunction with --stdout.\r
335 </simpara>\r
336 <simpara>Note: A thin pack violates the packed archive format by omitting\r
337 required objects and is thus unusable by git without making it\r
338 self-contained. Use <emphasis>git index-pack --fix-thin</emphasis>\r
339 (see <xref linkend="git-index-pack(1)" />) to restore the self-contained property.</simpara>\r
340 </listitem>\r
341 </varlistentry>\r
342 <varlistentry>\r
343 <term>\r
344 --delta-base-offset\r
345 </term>\r
346 <listitem>\r
347 <simpara>\r
348         A packed archive can express the base object of a delta as\r
349         either a 20-byte object name or as an offset in the\r
350         stream, but ancient versions of git don't understand the\r
351         latter.  By default, <emphasis>git pack-objects</emphasis> only uses the\r
352         former format for better compatibility.  This option\r
353         allows the command to use the latter format for\r
354         compactness.  Depending on the average delta chain\r
355         length, this option typically shrinks the resulting\r
356         packfile by 3-5 per-cent.\r
357 </simpara>\r
358 <simpara>Note: Porcelain commands such as <emphasis>git gc</emphasis> (see <xref linkend="git-gc(1)" />),\r
359 <emphasis>git repack</emphasis> (see <xref linkend="git-repack(1)" />) pass this option by default\r
360 in modern git when they put objects in your repository into pack files.\r
361 So does <emphasis>git bundle</emphasis> (see <xref linkend="git-bundle(1)" />) when it creates a bundle.</simpara>\r
362 </listitem>\r
363 </varlistentry>\r
364 <varlistentry>\r
365 <term>\r
366 --threads=&lt;n&gt;\r
367 </term>\r
368 <listitem>\r
369 <simpara>\r
370         Specifies the number of threads to spawn when searching for best\r
371         delta matches.  This requires that pack-objects be compiled with\r
372         pthreads otherwise this option is ignored with a warning.\r
373         This is meant to reduce packing time on multiprocessor machines.\r
374         The required amount of memory for the delta search window is\r
375         however multiplied by the number of threads.\r
376         Specifying 0 will cause git to auto-detect the number of CPU's\r
377         and set the number of threads accordingly.\r
378 </simpara>\r
379 </listitem>\r
380 </varlistentry>\r
381 <varlistentry>\r
382 <term>\r
383 --index-version=&lt;version&gt;[,&lt;offset&gt;]\r
384 </term>\r
385 <listitem>\r
386 <simpara>\r
387         This is intended to be used by the test suite only. It allows\r
388         to force the version for the generated pack index, and to force\r
389         64-bit index entries on objects located above the given offset.\r
390 </simpara>\r
391 </listitem>\r
392 </varlistentry>\r
393 <varlistentry>\r
394 <term>\r
395 --keep-true-parents\r
396 </term>\r
397 <listitem>\r
398 <simpara>\r
399         With this option, parents that are hidden by grafts are packed\r
400         nevertheless.\r
401 </simpara>\r
402 </listitem>\r
403 </varlistentry>\r
404 </variablelist>\r
405 </simplesect>\r
406 <simplesect id="_see_also">\r
407 <title>SEE ALSO</title>\r
408 <simpara><xref linkend="git-rev-list(1)" />\r
409 <xref linkend="git-repack(1)" />\r
410 <xref linkend="git-prune-packed(1)" /></simpara>\r
411 </simplesect>\r
412 <simplesect id="_git">\r
413 <title>GIT</title>\r
414 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
415 </simplesect>\r
416 </article>\r