packed_git: convert pack_local flag into a bitfield and add pack_keep
[git/git.git] / Documentation / git-pack-objects.txt
CommitLineData
5f40520f
JH
1git-pack-objects(1)
2===================
5f40520f
JH
3
4NAME
5----
7bd7f280 6git-pack-objects - Create a packed archive of objects
5f40520f
JH
7
8
9SYNOPSIS
10--------
ca5381d4 11[verse]
b1889c36 12'git pack-objects' [-q] [--no-reuse-delta] [--delta-base-offset] [--non-empty]
fa438a2e 13 [--local] [--incremental] [--window=N] [--depth=N] [--all-progress]
4321134c 14 [--revs [--unpacked | --all]*] [--stdout | base-name] < object-list
5f40520f
JH
15
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
ba1333fe
PE
25designed 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.
5f40520f 28
1e6ab5de
MK
29Placing 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
ba020ef5 33The 'git-unpack-objects' command can read the packed archive and
5f40520f
JH
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
ca5381d4
JH
39In 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
5f40520f
JH
43
44OPTIONS
45-------
46base-name::
47 Write into a pair of files (.pack and .idx), using
48 <base-name> to determine the name of the created file.
49 When this option is used, the two files are written in
50 <base-name>-<SHA1>.{pack,idx} files. <SHA1> is a hash
e23ed9a8
NP
51 of the sorted object names to make the resulting filename
52 based on the pack content, and written to the standard
5f40520f
JH
53 output of the command.
54
55--stdout::
89438677 56 Write the pack contents (what would have been written to
5f40520f
JH
57 .pack file) out to the standard output.
58
4321134c
JH
59--revs::
60 Read the revision arguments from the standard input, instead of
61 individual object names. The revision arguments are processed
ba020ef5 62 the same way as 'git-rev-list' with the `--objects` flag
4321134c
JH
63 uses its `commit` arguments to build the list of objects it
64 outputs. The objects on the resulting list are packed.
65
66--unpacked::
67 This implies `--revs`. When processing the list of
68 revision arguments read from the standard input, limit
69 the objects packed to those that are not already packed.
70
71--all::
72 This implies `--revs`. In addition to the list of
73 revision arguments read from the standard input, pretend
3df19671 74 as if all refs under `$GIT_DIR/refs` are specified to be
4321134c
JH
75 included.
76
f0a24aa5
SP
77--include-tag::
78 Include unasked-for annotated tags if the object they
79 reference was included in the resulting packfile. This
80 can be useful to send new tags to native git clients.
81
3240240f
SB
82--window=[N]::
83--depth=[N]::
3df19671 84 These two options affect how the objects contained in
5f40520f
JH
85 the pack are stored using delta compression. The
86 objects are first internally sorted by type, size and
87 optionally names and compared against the other objects
88 within --window to see if using delta compression saves
89 space. --depth limits the maximum delta depth; making
90 it too deep affects the performance on the unpacker
91 side, because delta data needs to be applied that many
92 times to get to the necessary object.
618e613a 93 The default value for --window is 10 and --depth is 50.
5f40520f 94
e93b15cd
BD
95--window-memory=[N]::
96 This option provides an additional limit on top of `--window`;
97 the window size will dynamically scale down so as to not take
98 up more than N bytes in memory. This is useful in
99 repositories with a mix of large and small objects to not run
100 out of memory with a large window, but still be able to take
101 advantage of the large window for the smaller objects. The
102 size can be suffixed with "k", "m", or "g".
103 `--window-memory=0` makes memory usage unlimited, which is the
104 default.
105
6b94b1a0
DH
106--max-pack-size=<n>::
107 Maximum size of each output packfile, expressed in MiB.
108 If specified, multiple packfiles may be created.
2b84b5a8
JS
109 The default is unlimited, unless the config variable
110 `pack.packSizeLimit` is set.
6b94b1a0 111
5f40520f
JH
112--incremental::
113 This flag causes an object already in a pack ignored
114 even if it appears in the standard input.
115
12ea5bea
JH
116--local::
117 This flag is similar to `--incremental`; instead of
118 ignoring all packed objects, it only ignores objects
119 that are packed and not in the local object store
120 (i.e. borrowed from an alternate).
5f40520f 121
63ae26f8
NW
122--non-empty::
123 Only create a packed archive if it would contain at
124 least one object.
125
231f240b
NP
126--progress::
127 Progress status is reported on the standard error stream
128 by default when it is attached to a terminal, unless -q
129 is specified. This flag forces progress status even if
130 the standard error stream is not directed to a terminal.
131
132--all-progress::
133 When --stdout is specified then progress report is
134 displayed during the object count and deltification phases
135 but inhibited during the write-out phase. The reason is
136 that in some cases the output stream is directly linked
137 to another command which may wish to display progress
138 status of its own as it processes incoming pack data.
139 This flag is like --progress except that it forces progress
140 report for the write-out phase as well even if --stdout is
141 used.
142
ca5381d4
JH
143-q::
144 This flag makes the command not to report its progress
145 on the standard error stream.
146
147--no-reuse-delta::
148 When creating a packed archive in a repository that
149 has existing packs, the command reuses existing deltas.
150 This sometimes results in a slightly suboptimal pack.
151 This flag tells the command not to reuse existing deltas
152 but compute them from scratch.
153
fa736f72
NP
154--no-reuse-object::
155 This flag tells the command not to reuse existing object data at all,
156 including non deltified object, forcing recompression of everything.
960ccca6 157 This implies --no-reuse-delta. Useful only in the obscure case where
fa736f72
NP
158 wholesale enforcement of a different compression level on the
159 packed data is desired.
160
960ccca6
DH
161--compression=[N]::
162 Specifies compression level for newly-compressed data in the
163 generated pack. If not specified, pack compression level is
164 determined first by pack.compression, then by core.compression,
165 and defaults to -1, the zlib default, if neither is set.
483bc4f0 166 Add --no-reuse-object if you want to force a uniform compression
05cc2ffc 167 level on all data no matter the source.
960ccca6 168
63fba759
JH
169--delta-base-offset::
170 A packed archive can express base object of a delta as
171 either 20-byte object name or as an offset in the
172 stream, but older version of git does not understand the
ba020ef5 173 latter. By default, 'git-pack-objects' only uses the
63fba759
JH
174 former format for better compatibility. This option
175 allows the command to use the latter format for
176 compactness. Depending on the average delta chain
177 length, this option typically shrinks the resulting
178 packfile by 3-5 per-cent.
179
367f4a43
NP
180--threads=<n>::
181 Specifies the number of threads to spawn when searching for best
182 delta matches. This requires that pack-objects be compiled with
183 pthreads otherwise this option is ignored with a warning.
184 This is meant to reduce packing time on multiprocessor machines.
185 The required amount of memory for the delta search window is
186 however multiplied by the number of threads.
833e3df1
AE
187 Specifying 0 will cause git to auto-detect the number of CPU's
188 and set the number of threads accordingly.
367f4a43 189
be18c1fe
NP
190--index-version=<version>[,<offset>]::
191 This is intended to be used by the test suite only. It allows
192 to force the version for the generated pack index, and to force
193 64-bit index entries on objects located above the given offset.
194
ca5381d4 195
5f40520f
JH
196Author
197------
198Written by Linus Torvalds <torvalds@osdl.org>
199
200Documentation
201-------------
202Documentation by Junio C Hamano
203
56ae8df5 204SEE ALSO
e31bb3bb 205--------
5162e697
DM
206linkgit:git-rev-list[1]
207linkgit:git-repack[1]
208linkgit:git-prune-packed[1]
e31bb3bb 209
5f40520f
JH
210GIT
211---
9e1f0a85 212Part of the linkgit:git[1] suite