blob: 8c354bd47014825de71243d73158b6b080ecb350 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-pack-objects(1)
2===================
3
4NAME
5----
Junio C Hamano01078922006-03-10 00:31:476git-pack-objects - Create a packed archive of objects
Junio C Hamano1a4e8412005-12-27 08:17:237
8
9SYNOPSIS
10--------
Junio C Hamano7e9f6b72006-02-22 10:44:5511[verse]
Junio C Hamanofce7c7e2008-07-02 03:06:3812'git pack-objects' [-q] [--no-reuse-delta] [--delta-base-offset] [--non-empty]
Junio C Hamano125a17b2006-11-05 08:59:3513[--local] [--incremental] [--window=N] [--depth=N] [--all-progress]
Junio C Hamano3eb513f2006-09-18 02:47:1614[--revs [--unpacked | --all]*] [--stdout | base-name] < object-list
Junio C Hamano1a4e8412005-12-27 08:17:2315
16
17DESCRIPTION
18-----------
19Reads list of objects from the standard input, and writes a packed
20archive with specified base-name, or to the standard output.
21
22A packed archive is an efficient way to transfer set of objects
23between two repositories, and also is an archival format which
24is efficient to access. The packed archive format (.pack) is
Junio C Hamanob553b792008-04-06 02:02:3725designed to be self contained so that it can be unpacked without
26any further information, but for fast, random access to the objects
27in the pack, a pack index file (.idx) will be generated.
Junio C Hamano1a4e8412005-12-27 08:17:2328
Junio C Hamano9810d632007-09-24 01:05:3429Placing both in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or
30any of the directories on $GIT_ALTERNATE_OBJECT_DIRECTORIES)
31enables git to read from such an archive.
32
Junio C Hamanoba4b9282008-07-06 05:20:3133The 'git-unpack-objects' command can read the packed archive and
Junio C Hamano1a4e8412005-12-27 08:17:2334expand the objects contained in the pack into "one-file
35one-object" format; this is typically done by the smart-pull
36commands when a pack is created on-the-fly for efficient network
37transport by their peers.
38
Junio C Hamano7e9f6b72006-02-22 10:44:5539In a packed archive, an object is either stored as a compressed
40whole, or as a difference from some other object. The latter is
41often called a delta.
42
Junio C Hamano1a4e8412005-12-27 08:17:2343
44OPTIONS
45-------
46base-name::
47Write into a pair of files (.pack and .idx), using
48<base-name> to determine the name of the created file.
49When this option is used, the two files are written in
50<base-name>-<SHA1>.{pack,idx} files. <SHA1> is a hash
Junio C Hamanoa2ec14f2006-11-02 00:22:4851of the sorted object names to make the resulting filename
52based on the pack content, and written to the standard
Junio C Hamano1a4e8412005-12-27 08:17:2353output of the command.
54
55--stdout::
Junio C Hamano235a91e2006-01-07 01:13:5856Write the pack contents (what would have been written to
Junio C Hamano1a4e8412005-12-27 08:17:2357.pack file) out to the standard output.
58
Junio C Hamano3eb513f2006-09-18 02:47:1659--revs::
60Read the revision arguments from the standard input, instead of
61individual object names. The revision arguments are processed
Junio C Hamanoba4b9282008-07-06 05:20:3162the same way as 'git-rev-list' with the `--objects` flag
Junio C Hamano3eb513f2006-09-18 02:47:1663uses its `commit` arguments to build the list of objects it
64outputs. The objects on the resulting list are packed.
65
66--unpacked::
67This implies `--revs`. When processing the list of
68revision arguments read from the standard input, limit
69the objects packed to those that are not already packed.
70
71--all::
72This implies `--revs`. In addition to the list of
73revision arguments read from the standard input, pretend
Junio C Hamano93567a62006-10-08 08:47:5674as if all refs under `$GIT_DIR/refs` are specified to be
Junio C Hamano3eb513f2006-09-18 02:47:1675included.
76
Junio C Hamanobb343172008-03-09 10:39:0977--include-tag::
78Include unasked-for annotated tags if the object they
79reference was included in the resulting packfile. This
80can be useful to send new tags to native git clients.
81
Junio C Hamanoeb415992008-06-08 22:49:4782--window=[N]::
83--depth=[N]::
Junio C Hamano93567a62006-10-08 08:47:5684These two options affect how the objects contained in
Junio C Hamano1a4e8412005-12-27 08:17:2385the pack are stored using delta compression. The
86objects are first internally sorted by type, size and
87optionally names and compared against the other objects
88within --window to see if using delta compression saves
89space. --depth limits the maximum delta depth; making
90it too deep affects the performance on the unpacker
91side, because delta data needs to be applied that many
92times to get to the necessary object.
Junio C Hamano91d44c52007-05-09 07:16:0793The default value for --window is 10 and --depth is 50.
Junio C Hamano1a4e8412005-12-27 08:17:2394
Junio C Hamano235d53f2007-07-13 00:25:1595--window-memory=[N]::
96This option provides an additional limit on top of `--window`;
97the window size will dynamically scale down so as to not take
98up more than N bytes in memory. This is useful in
99repositories with a mix of large and small objects to not run
100out of memory with a large window, but still be able to take
101advantage of the large window for the smaller objects. The
102size can be suffixed with "k", "m", or "g".
103`--window-memory=0` makes memory usage unlimited, which is the
104default.
105
Junio C Hamano591dc6a2007-05-29 09:18:19106--max-pack-size=<n>::
107Maximum size of each output packfile, expressed in MiB.
108If specified, multiple packfiles may be created.
Junio C Hamano49dccaf2008-02-10 10:48:01109The default is unlimited, unless the config variable
110`pack.packSizeLimit` is set.
Junio C Hamano591dc6a2007-05-29 09:18:19111
Junio C Hamano1a4e8412005-12-27 08:17:23112--incremental::
113This flag causes an object already in a pack ignored
114even if it appears in the standard input.
115
116--local::
117This flag is similar to `--incremental`; instead of
118ignoring all packed objects, it only ignores objects
119that are packed and not in the local object store
120(i.e. borrowed from an alternate).
121
122--non-empty::
123 Only create a packed archive if it would contain at
124 least one object.
125
Junio C Hamano0d3c8152006-11-08 01:33:41126--progress::
127Progress status is reported on the standard error stream
128by default when it is attached to a terminal, unless -q
129is specified. This flag forces progress status even if
130the standard error stream is not directed to a terminal.
131
132--all-progress::
133When --stdout is specified then progress report is
134displayed during the object count and deltification phases
135but inhibited during the write-out phase. The reason is
136that in some cases the output stream is directly linked
137to another command which may wish to display progress
138status of its own as it processes incoming pack data.
139This flag is like --progress except that it forces progress
140report for the write-out phase as well even if --stdout is
141used.
142
Junio C Hamano7e9f6b72006-02-22 10:44:55143-q::
144This flag makes the command not to report its progress
145on the standard error stream.
146
147--no-reuse-delta::
148When creating a packed archive in a repository that
149has existing packs, the command reuses existing deltas.
150This sometimes results in a slightly suboptimal pack.
151This flag tells the command not to reuse existing deltas
152but compute them from scratch.
153
Junio C Hamanof2ce2972007-05-20 19:12:09154--no-reuse-object::
155This flag tells the command not to reuse existing object data at all,
156including non deltified object, forcing recompression of everything.
157This implies --no-reuse-delta. Useful only in the obscure case where
158wholesale enforcement of a different compression level on the
159packed data is desired.
160
161--compression=[N]::
162Specifies compression level for newly-compressed data in the
163generated pack. If not specified, pack compression level is
164determined first by pack.compression, then by core.compression,
165and defaults to -1, the zlib default, if neither is set.
Junio C Hamanofce7c7e2008-07-02 03:06:38166Add --no-reuse-object if you want to force a uniform compression
Junio C Hamanoef4c2d12007-09-10 08:11:27167level on all data no matter the source.
Junio C Hamanof2ce2972007-05-20 19:12:09168
Junio C Hamano77b7e902006-10-23 07:18:50169--delta-base-offset::
170A packed archive can express base object of a delta as
171either 20-byte object name or as an offset in the
172stream, but older version of git does not understand the
Junio C Hamanoba4b9282008-07-06 05:20:31173latter. By default, 'git-pack-objects' only uses the
Junio C Hamano77b7e902006-10-23 07:18:50174former format for better compatibility. This option
175allows the command to use the latter format for
176compactness. Depending on the average delta chain
177length, this option typically shrinks the resulting
178packfile by 3-5 per-cent.
179
Junio C Hamano58155b42007-09-15 07:46:14180--threads=<n>::
181Specifies the number of threads to spawn when searching for best
182delta matches. This requires that pack-objects be compiled with
183pthreads otherwise this option is ignored with a warning.
184This is meant to reduce packing time on multiprocessor machines.
185The required amount of memory for the delta search window is
186however multiplied by the number of threads.
Junio C Hamano24bc09a2008-02-28 00:27:44187Specifying 0 will cause git to auto-detect the number of CPU's
188and set the number of threads accordingly.
Junio C Hamano58155b42007-09-15 07:46:14189
Junio C Hamanoe90436a2007-04-22 07:22:13190--index-version=<version>[,<offset>]::
191This is intended to be used by the test suite only. It allows
192to force the version for the generated pack index, and to force
19364-bit index entries on objects located above the given offset.
194
Junio C Hamano7e9f6b72006-02-22 10:44:55195
Junio C Hamano1a4e8412005-12-27 08:17:23196Author
197------
198Written by Linus Torvalds <torvalds@osdl.org>
199
200Documentation
201-------------
202Documentation by Junio C Hamano
203
Junio C Hamano9049d912008-05-29 02:09:50204SEE ALSO
Junio C Hamano1a4e8412005-12-27 08:17:23205--------
Junio C Hamano35738e82008-01-07 07:55:46206linkgit:git-rev-list[1]
207linkgit:git-repack[1]
208linkgit:git-prune-packed[1]
Junio C Hamano1a4e8412005-12-27 08:17:23209
210GIT
211---
Junio C Hamanof7c042d2008-06-06 22:50:53212Part of the linkgit:git[1] suite