]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-repack.txt
Merge branch 'cw/pack-config-doc'
[thirdparty/git.git] / Documentation / git-repack.txt
CommitLineData
215a7ad1
JH
1git-repack(1)
2=============
e31bb3bb
JH
3
4NAME
5----
c3f0baac 6git-repack - Pack unpacked objects in a repository
e31bb3bb
JH
7
8
9SYNOPSIS
10--------
7791a1d9 11[verse]
ed7e5fc3 12'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [-b] [--window=<n>] [--depth=<n>] [--threads=<n>] [--keep-pack=<pack-name>]
e31bb3bb
JH
13
14DESCRIPTION
15-----------
e31bb3bb 16
35c14176 17This command is used to combine all objects that do not currently
02783075 18reside in a "pack", into a pack. It can also be used to re-organize
38d697a1 19existing packs into a single, more efficient pack.
f85a4191
JH
20
21A pack is a collection of objects, individually compressed, with
22delta compression applied, stored in a single file, with an
23associated index file.
24
25Packs are used to reduce the load on mirror systems, backup
26engines, disk storage, etc.
27
28OPTIONS
29-------
30
31-a::
32 Instead of incrementally packing the unpacked objects,
38d697a1 33 pack everything referenced into a single pack.
f85a4191 34 Especially useful when packing a repository that is used
9a8531ee 35 for private development. Use
23f8239b 36 with `-d`. This will clean up the objects that `git prune`
c6a13b2c 37 leaves behind, but `git fsck --full --dangling` shows as
38d697a1 38 dangling.
9a8531ee
MG
39+
40Note that users fetching over dumb protocols will have to fetch the
41whole new pack in order to get any contained object, no matter how many
42other objects in that pack they already have locally.
5d19e813
JT
43+
44Promisor packfiles are repacked separately: if there are packfiles that
45have an associated ".promisor" file, these packfiles will be repacked
46into another separate pack, and an empty ".promisor" file corresponding
47to the new separate pack will be written.
f85a4191 48
bbefaa1f 49-A::
23f8239b 50 Same as `-a`, unless `-d` is used. Then any unreachable
83d0289d
BC
51 objects in a previous pack become loose, unpacked objects,
52 instead of being left in the old pack. Unreachable objects
53 are never intentionally added to a pack, even when repacking.
54 This option prevents unreachable objects from being immediately
bbefaa1f
CF
55 deleted by way of being left in the old pack and then
56 removed. Instead, the loose unreachable objects
57 will be pruned according to normal expiry rules
0b444cdb 58 with the next 'git gc' invocation. See linkgit:git-gc[1].
bbefaa1f 59
f85a4191
JH
60-d::
61 After packing, if the newly created packs make some
62 existing packs redundant, remove the redundant packs.
0b444cdb 63 Also run 'git prune-packed' to remove redundant
483bc4f0 64 loose object files.
e31bb3bb 65
31f23281 66-l::
0b444cdb 67 Pass the `--local` option to 'git pack-objects'. See
5162e697 68 linkgit:git-pack-objects[1].
31f23281 69
cec2be76 70-f::
5c47e1c7
JK
71 Pass the `--no-reuse-delta` option to `git-pack-objects`, see
72 linkgit:git-pack-objects[1].
73
74-F::
8d11fdea 75 Pass the `--no-reuse-object` option to `git-pack-objects`, see
5162e697 76 linkgit:git-pack-objects[1].
cec2be76
JH
77
78-q::
0b444cdb 79 Pass the `-q` option to 'git pack-objects'. See
5162e697 80 linkgit:git-pack-objects[1].
cec2be76 81
31f23281 82-n::
c30f9936 83 Do not update the server information with
0b444cdb 84 'git update-server-info'. This option skips
c30f9936
SP
85 updating local catalog files needed to publish
86 this repository (or a direct copy of it)
0cafe944 87 over HTTP or FTP. See linkgit:git-update-server-info[1].
e31bb3bb 88
62b4698e
ŠN
89--window=<n>::
90--depth=<n>::
3df19671 91 These two options affect how the objects contained in the pack are
02ac04fc
JF
92 stored using delta compression. The objects are first internally
93 sorted by type, size and optionally names and compared against the
94 other objects within `--window` to see if using delta compression saves
95 space. `--depth` limits the maximum delta depth; making it too deep
96 affects the performance on the unpacker side, because delta data needs
97 to be applied that many times to get to the necessary object.
b5c0cbd8
NTND
98+
99The default value for --window is 10 and --depth is 50. The maximum
100depth is 4095.
02ac04fc 101
40bcf318
JH
102--threads=<n>::
103 This option is passed through to `git pack-objects`.
104
62b4698e 105--window-memory=<n>::
e93b15cd
BD
106 This option provides an additional limit on top of `--window`;
107 the window size will dynamically scale down so as to not take
62b4698e 108 up more than '<n>' bytes in memory. This is useful in
e93b15cd
BD
109 repositories with a mix of large and small objects to not run
110 out of memory with a large window, but still be able to take
111 advantage of the large window for the smaller objects. The
112 size can be suffixed with "k", "m", or "g".
954176c1
MS
113 `--window-memory=0` makes memory usage unlimited. The default
114 is taken from the `pack.windowMemory` configuration variable.
115 Note that the actual memory usage will be the limit multiplied
116 by the number of threads used by linkgit:git-pack-objects[1].
e93b15cd 117
62b4698e 118--max-pack-size=<n>::
07cf0f24
NP
119 Maximum size of each output pack file. The size can be suffixed with
120 "k", "m", or "g". The minimum size allowed is limited to 1 MiB.
9cea46cd
EW
121 If specified, multiple packfiles may be created, which also
122 prevents the creation of a bitmap index.
07cf0f24
NP
123 The default is unlimited, unless the config variable
124 `pack.packSizeLimit` is set.
6b94b1a0 125
5cf2741c
VM
126-b::
127--write-bitmap-index::
128 Write a reachability bitmap index as part of the repack. This
129 only makes sense when used with `-a` or `-A`, as the bitmaps
130 must be able to refer to all reachable objects. This option
9cea46cd
EW
131 overrides the setting of `repack.writeBitmaps`. This option
132 has no effect if multiple packfiles are created.
5cf2741c 133
ee34a2be
JK
134--pack-kept-objects::
135 Include objects in `.keep` files when repacking. Note that we
136 still do not delete `.keep` packs after `pack-objects` finishes.
137 This means that we may duplicate objects, but this makes the
138 option safe to use when there are concurrent pushes or fetches.
139 This option is generally only useful if you are writing bitmaps
9cea46cd 140 with `-b` or `repack.writeBitmaps`, as it ensures that the
ee34a2be 141 bitmapped packfile has the necessary objects.
02ac04fc 142
ed7e5fc3
NTND
143--keep-pack=<pack-name>::
144 Exclude the given pack from repacking. This is the equivalent
24966cd9 145 of having `.keep` file on the pack. `<pack-name>` is the
ed7e5fc3
NTND
146 pack file name without leading directory (e.g. `pack-123.pack`).
147 The option could be specified multiple times to keep multiple
148 packs.
149
6a7bcb54
JK
150--unpack-unreachable=<when>::
151 When loosening unreachable objects, do not bother loosening any
152 objects older than `<when>`. This can be used to optimize out
153 the write of any objects that would be immediately pruned by
154 a follow-up `git prune`.
155
905f27b8
JK
156-k::
157--keep-unreachable::
158 When used with `-ad`, any unreachable objects from existing
159 packs will be appended to the end of the packfile instead of
e26a8c47
JK
160 being removed. In addition, any unreachable loose objects will
161 be packed (and their loose counterparts removed).
905f27b8 162
16d75fa4
JK
163-i::
164--delta-islands::
165 Pass the `--delta-islands` option to `git-pack-objects`, see
166 linkgit:git-pack-objects[1].
167
3a837b58 168CONFIGURATION
b6945f57
JH
169-------------
170
3a837b58
CW
171Various configuration variables affect packing, see
172linkgit:git-config[1] (search for "pack" and "delta").
173
9f17688d
NP
174By default, the command passes `--delta-base-offset` option to
175'git pack-objects'; this typically results in slightly smaller packs,
176but the generated packs are incompatible with versions of Git older than
177version 1.4.4. If you need to share your repository with such ancient Git
0d0bac67 178versions, either directly or via the dumb http protocol, then you
9f17688d
NP
179need to set the configuration variable `repack.UseDeltaBaseOffset` to
180"false" and repack. Access from old Git versions over the native protocol
181is unaffected by this option as the conversion is performed on the fly
182as needed in that case.
b6945f57 183
3a837b58
CW
184Delta compression is not used on objects larger than the
185`core.bigFileThreshold` configuration variable and on files with the
186attribute `delta` set to false.
187
56ae8df5 188SEE ALSO
e31bb3bb 189--------
5162e697
DM
190linkgit:git-pack-objects[1]
191linkgit:git-prune-packed[1]
e31bb3bb
JH
192
193GIT
194---
9e1f0a85 195Part of the linkgit:git[1] suite