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
4 <article lang="en" id="git-pack-objects(1)">
\r
6 <title>git-pack-objects(1)</title>
\r
8 <primary>git-pack-objects(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-pack-objects - Create a packed archive of objects</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\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=<n>] [--depth=<n>]
\r
21 [--revs [--unpacked | --all]] [--stdout | base-name]
\r
22 [--keep-true-parents] < object-list</literallayout>
\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
48 <simplesect id="_options">
\r
49 <title>OPTIONS</title>
\r
57 Write into a pair of files (.pack and .idx), using
\r
58 <base-name> to determine the name of the created file.
\r
59 When this option is used, the two files are written in
\r
60 <base-name>-<SHA1>.{pack,idx} files. <SHA1> 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
73 Write the pack contents (what would have been written to
\r
74 .pack file) out to the standard output.
\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
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
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
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
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
153 --window-memory=<n>
\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><n></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
171 --max-pack-size=<n>
\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
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
201 This flag causes an object already in a pack to be ignored
\r
202 even if it would have otherwise been packed.
\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
224 Only create a packed archive if it would contain at
\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
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
262 --all-progress-implied
\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
278 This flag makes the command not to report its progress
\r
279 on the standard error stream.
\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
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
313 --compression=<n>
\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
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
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
344 --delta-base-offset
\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
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
366 --threads=<n>
\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
383 --index-version=<version>[,<offset>]
\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
395 --keep-true-parents
\r
399 With this option, parents that are hidden by grafts are packed
\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
412 <simplesect id="_git">
\r
414 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r