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