blob: 8353be186fcc83092acac16b4fc164d6ea669621 [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 Hamano77b7e902006-10-23 07:18:5012'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
25designed to be unpackable without having anything else, but for
26random access, accompanied with the pack index file (.idx).
27
Junio C Hamano9810d632007-09-24 01:05:3428Placing both in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or
29any of the directories on $GIT_ALTERNATE_OBJECT_DIRECTORIES)
30enables git to read from such an archive.
31
Junio C Hamano1a4e8412005-12-27 08:17:2332'git-unpack-objects' command can read the packed archive and
33expand the objects contained in the pack into "one-file
34one-object" format; this is typically done by the smart-pull
35commands when a pack is created on-the-fly for efficient network
36transport by their peers.
37
Junio C Hamano7e9f6b72006-02-22 10:44:5538In a packed archive, an object is either stored as a compressed
39whole, or as a difference from some other object. The latter is
40often called a delta.
41
Junio C Hamano1a4e8412005-12-27 08:17:2342
43OPTIONS
44-------
45base-name::
46Write into a pair of files (.pack and .idx), using
47<base-name> to determine the name of the created file.
48When this option is used, the two files are written in
49<base-name>-<SHA1>.{pack,idx} files. <SHA1> is a hash
Junio C Hamanoa2ec14f2006-11-02 00:22:4850of the sorted object names to make the resulting filename
51based on the pack content, and written to the standard
Junio C Hamano1a4e8412005-12-27 08:17:2352output of the command.
53
54--stdout::
Junio C Hamano235a91e2006-01-07 01:13:5855Write the pack contents (what would have been written to
Junio C Hamano1a4e8412005-12-27 08:17:2356.pack file) out to the standard output.
57
Junio C Hamano3eb513f2006-09-18 02:47:1658--revs::
59Read the revision arguments from the standard input, instead of
60individual object names. The revision arguments are processed
Junio C Hamano35738e82008-01-07 07:55:4661the same way as linkgit:git-rev-list[1] with `--objects` flag
Junio C Hamano3eb513f2006-09-18 02:47:1662uses its `commit` arguments to build the list of objects it
63outputs. The objects on the resulting list are packed.
64
65--unpacked::
66This implies `--revs`. When processing the list of
67revision arguments read from the standard input, limit
68the objects packed to those that are not already packed.
69
70--all::
71This implies `--revs`. In addition to the list of
72revision arguments read from the standard input, pretend
Junio C Hamano93567a62006-10-08 08:47:5673as if all refs under `$GIT_DIR/refs` are specified to be
Junio C Hamano3eb513f2006-09-18 02:47:1674included.
75
Junio C Hamano93567a62006-10-08 08:47:5676--window=[N], --depth=[N]::
77These two options affect how the objects contained in
Junio C Hamano1a4e8412005-12-27 08:17:2378the pack are stored using delta compression. The
79objects are first internally sorted by type, size and
80optionally names and compared against the other objects
81within --window to see if using delta compression saves
82space. --depth limits the maximum delta depth; making
83it too deep affects the performance on the unpacker
84side, because delta data needs to be applied that many
85times to get to the necessary object.
Junio C Hamano91d44c52007-05-09 07:16:0786The default value for --window is 10 and --depth is 50.
Junio C Hamano1a4e8412005-12-27 08:17:2387
Junio C Hamano235d53f2007-07-13 00:25:1588--window-memory=[N]::
89This option provides an additional limit on top of `--window`;
90the window size will dynamically scale down so as to not take
91up more than N bytes in memory. This is useful in
92repositories with a mix of large and small objects to not run
93out of memory with a large window, but still be able to take
94advantage of the large window for the smaller objects. The
95size can be suffixed with "k", "m", or "g".
96`--window-memory=0` makes memory usage unlimited, which is the
97default.
98
Junio C Hamano591dc6a2007-05-29 09:18:1999--max-pack-size=<n>::
100Maximum size of each output packfile, expressed in MiB.
101If specified, multiple packfiles may be created.
Junio C Hamano49dccaf2008-02-10 10:48:01102The default is unlimited, unless the config variable
103`pack.packSizeLimit` is set.
Junio C Hamano591dc6a2007-05-29 09:18:19104
Junio C Hamano1a4e8412005-12-27 08:17:23105--incremental::
106This flag causes an object already in a pack ignored
107even if it appears in the standard input.
108
109--local::
110This flag is similar to `--incremental`; instead of
111ignoring all packed objects, it only ignores objects
112that are packed and not in the local object store
113(i.e. borrowed from an alternate).
114
115--non-empty::
116 Only create a packed archive if it would contain at
117 least one object.
118
Junio C Hamano0d3c8152006-11-08 01:33:41119--progress::
120Progress status is reported on the standard error stream
121by default when it is attached to a terminal, unless -q
122is specified. This flag forces progress status even if
123the standard error stream is not directed to a terminal.
124
125--all-progress::
126When --stdout is specified then progress report is
127displayed during the object count and deltification phases
128but inhibited during the write-out phase. The reason is
129that in some cases the output stream is directly linked
130to another command which may wish to display progress
131status of its own as it processes incoming pack data.
132This flag is like --progress except that it forces progress
133report for the write-out phase as well even if --stdout is
134used.
135
Junio C Hamano7e9f6b72006-02-22 10:44:55136-q::
137This flag makes the command not to report its progress
138on the standard error stream.
139
140--no-reuse-delta::
141When creating a packed archive in a repository that
142has existing packs, the command reuses existing deltas.
143This sometimes results in a slightly suboptimal pack.
144This flag tells the command not to reuse existing deltas
145but compute them from scratch.
146
Junio C Hamanof2ce2972007-05-20 19:12:09147--no-reuse-object::
148This flag tells the command not to reuse existing object data at all,
149including non deltified object, forcing recompression of everything.
150This implies --no-reuse-delta. Useful only in the obscure case where
151wholesale enforcement of a different compression level on the
152packed data is desired.
153
154--compression=[N]::
155Specifies compression level for newly-compressed data in the
156generated pack. If not specified, pack compression level is
157determined first by pack.compression, then by core.compression,
158and defaults to -1, the zlib default, if neither is set.
Junio C Hamanoef4c2d12007-09-10 08:11:27159Add \--no-reuse-object if you want to force a uniform compression
160level on all data no matter the source.
Junio C Hamanof2ce2972007-05-20 19:12:09161
Junio C Hamano77b7e902006-10-23 07:18:50162--delta-base-offset::
163A packed archive can express base object of a delta as
164either 20-byte object name or as an offset in the
165stream, but older version of git does not understand the
166latter. By default, git-pack-objects only uses the
167former format for better compatibility. This option
168allows the command to use the latter format for
169compactness. Depending on the average delta chain
170length, this option typically shrinks the resulting
171packfile by 3-5 per-cent.
172
Junio C Hamano58155b42007-09-15 07:46:14173--threads=<n>::
174Specifies the number of threads to spawn when searching for best
175delta matches. This requires that pack-objects be compiled with
176pthreads otherwise this option is ignored with a warning.
177This is meant to reduce packing time on multiprocessor machines.
178The required amount of memory for the delta search window is
179however multiplied by the number of threads.
180
Junio C Hamanoe90436a2007-04-22 07:22:13181--index-version=<version>[,<offset>]::
182This is intended to be used by the test suite only. It allows
183to force the version for the generated pack index, and to force
18464-bit index entries on objects located above the given offset.
185
Junio C Hamano7e9f6b72006-02-22 10:44:55186
Junio C Hamano1a4e8412005-12-27 08:17:23187Author
188------
189Written by Linus Torvalds <torvalds@osdl.org>
190
191Documentation
192-------------
193Documentation by Junio C Hamano
194
Junio C Hamanodecf50e2006-03-05 10:51:14195See Also
Junio C Hamano1a4e8412005-12-27 08:17:23196--------
Junio C Hamano35738e82008-01-07 07:55:46197linkgit:git-rev-list[1]
198linkgit:git-repack[1]
199linkgit:git-prune-packed[1]
Junio C Hamano1a4e8412005-12-27 08:17:23200
201GIT
202---
Junio C Hamano35738e82008-01-07 07:55:46203Part of the linkgit:git[7] suite