blob: d5a87effa4b3f15895eb8956cd4180f71a32dff7 [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
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 Hamano1a4e8412005-12-27 08:17:2333'git-unpack-objects' command can read the packed archive and
34expand 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 Hamano35738e82008-01-07 07:55:4662the same way as linkgit:git-rev-list[1] with `--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 Hamano93567a62006-10-08 08:47:5682--window=[N], --depth=[N]::
83These two options affect how the objects contained in
Junio C Hamano1a4e8412005-12-27 08:17:2384the pack are stored using delta compression. The
85objects are first internally sorted by type, size and
86optionally names and compared against the other objects
87within --window to see if using delta compression saves
88space. --depth limits the maximum delta depth; making
89it too deep affects the performance on the unpacker
90side, because delta data needs to be applied that many
91times to get to the necessary object.
Junio C Hamano91d44c52007-05-09 07:16:0792The default value for --window is 10 and --depth is 50.
Junio C Hamano1a4e8412005-12-27 08:17:2393
Junio C Hamano235d53f2007-07-13 00:25:1594--window-memory=[N]::
95This option provides an additional limit on top of `--window`;
96the window size will dynamically scale down so as to not take
97up more than N bytes in memory. This is useful in
98repositories with a mix of large and small objects to not run
99out of memory with a large window, but still be able to take
100advantage of the large window for the smaller objects. The
101size can be suffixed with "k", "m", or "g".
102`--window-memory=0` makes memory usage unlimited, which is the
103default.
104
Junio C Hamano591dc6a2007-05-29 09:18:19105--max-pack-size=<n>::
106Maximum size of each output packfile, expressed in MiB.
107If specified, multiple packfiles may be created.
Junio C Hamano49dccaf2008-02-10 10:48:01108The default is unlimited, unless the config variable
109`pack.packSizeLimit` is set.
Junio C Hamano591dc6a2007-05-29 09:18:19110
Junio C Hamano1a4e8412005-12-27 08:17:23111--incremental::
112This flag causes an object already in a pack ignored
113even if it appears in the standard input.
114
115--local::
116This flag is similar to `--incremental`; instead of
117ignoring all packed objects, it only ignores objects
118that are packed and not in the local object store
119(i.e. borrowed from an alternate).
120
121--non-empty::
122 Only create a packed archive if it would contain at
123 least one object.
124
Junio C Hamano0d3c8152006-11-08 01:33:41125--progress::
126Progress status is reported on the standard error stream
127by default when it is attached to a terminal, unless -q
128is specified. This flag forces progress status even if
129the standard error stream is not directed to a terminal.
130
131--all-progress::
132When --stdout is specified then progress report is
133displayed during the object count and deltification phases
134but inhibited during the write-out phase. The reason is
135that in some cases the output stream is directly linked
136to another command which may wish to display progress
137status of its own as it processes incoming pack data.
138This flag is like --progress except that it forces progress
139report for the write-out phase as well even if --stdout is
140used.
141
Junio C Hamano7e9f6b72006-02-22 10:44:55142-q::
143This flag makes the command not to report its progress
144on the standard error stream.
145
146--no-reuse-delta::
147When creating a packed archive in a repository that
148has existing packs, the command reuses existing deltas.
149This sometimes results in a slightly suboptimal pack.
150This flag tells the command not to reuse existing deltas
151but compute them from scratch.
152
Junio C Hamanof2ce2972007-05-20 19:12:09153--no-reuse-object::
154This flag tells the command not to reuse existing object data at all,
155including non deltified object, forcing recompression of everything.
156This implies --no-reuse-delta. Useful only in the obscure case where
157wholesale enforcement of a different compression level on the
158packed data is desired.
159
160--compression=[N]::
161Specifies compression level for newly-compressed data in the
162generated pack. If not specified, pack compression level is
163determined first by pack.compression, then by core.compression,
164and defaults to -1, the zlib default, if neither is set.
Junio C Hamanoef4c2d12007-09-10 08:11:27165Add \--no-reuse-object if you want to force a uniform compression
166level on all data no matter the source.
Junio C Hamanof2ce2972007-05-20 19:12:09167
Junio C Hamano77b7e902006-10-23 07:18:50168--delta-base-offset::
169A packed archive can express base object of a delta as
170either 20-byte object name or as an offset in the
171stream, but older version of git does not understand the
172latter. By default, git-pack-objects only uses the
173former format for better compatibility. This option
174allows the command to use the latter format for
175compactness. Depending on the average delta chain
176length, this option typically shrinks the resulting
177packfile by 3-5 per-cent.
178
Junio C Hamano58155b42007-09-15 07:46:14179--threads=<n>::
180Specifies the number of threads to spawn when searching for best
181delta matches. This requires that pack-objects be compiled with
182pthreads otherwise this option is ignored with a warning.
183This is meant to reduce packing time on multiprocessor machines.
184The required amount of memory for the delta search window is
185however multiplied by the number of threads.
Junio C Hamano24bc09a2008-02-28 00:27:44186Specifying 0 will cause git to auto-detect the number of CPU's
187and set the number of threads accordingly.
Junio C Hamano58155b42007-09-15 07:46:14188
Junio C Hamanoe90436a2007-04-22 07:22:13189--index-version=<version>[,<offset>]::
190This is intended to be used by the test suite only. It allows
191to force the version for the generated pack index, and to force
19264-bit index entries on objects located above the given offset.
193
Junio C Hamano7e9f6b72006-02-22 10:44:55194
Junio C Hamano1a4e8412005-12-27 08:17:23195Author
196------
197Written by Linus Torvalds <torvalds@osdl.org>
198
199Documentation
200-------------
201Documentation by Junio C Hamano
202
Junio C Hamano9049d912008-05-29 02:09:50203SEE ALSO
Junio C Hamano1a4e8412005-12-27 08:17:23204--------
Junio C Hamano35738e82008-01-07 07:55:46205linkgit:git-rev-list[1]
206linkgit:git-repack[1]
207linkgit:git-prune-packed[1]
Junio C Hamano1a4e8412005-12-27 08:17:23208
209GIT
210---
Junio C Hamanof7c042d2008-06-06 22:50:53211Part of the linkgit:git[1] suite