3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.40.1.423.g2807bd2c10
10 .TH "GIT\-REPACK" "1" "04/25/2023" "Git 2\&.40\&.1\&.423\&.g2807bd" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-repack \- Pack unpacked objects in a repository
35 \fIgit repack\fR [\-a] [\-A] [\-d] [\-f] [\-F] [\-l] [\-n] [\-q] [\-b] [\-m] [\-\-window=<n>] [\-\-depth=<n>] [\-\-threads=<n>] [\-\-keep\-pack=<pack\-name>] [\-\-write\-midx]
40 This command is used to combine all objects that do not currently reside in a "pack", into a pack\&. It can also be used to re\-organize existing packs into a single, more efficient pack\&.
42 A pack is a collection of objects, individually compressed, with delta compression applied, stored in a single file, with an associated index file\&.
44 Packs are used to reduce the load on mirror systems, backup engines, disk storage, etc\&.
49 Instead of incrementally packing the unpacked objects, pack everything referenced into a single pack\&. Especially useful when packing a repository that is used for private development\&. Use with
50 \fB\-d\fR\&. This will clean up the objects that
53 \fBgit fsck \-\-full \-\-dangling\fR
56 Note that users fetching over dumb protocols will have to fetch the whole new pack in order to get any contained object, no matter how many other objects in that pack they already have locally\&.
58 Promisor packfiles are repacked separately: if there are packfiles that have an associated "\&.promisor" file, these packfiles will be repacked into another separate pack, and an empty "\&.promisor" file corresponding to the new separate pack will be written\&.
66 is used\&. Then any unreachable objects in a previous pack become loose, unpacked objects, instead of being left in the old pack\&. Unreachable objects are never intentionally added to a pack, even when repacking\&. This option prevents unreachable objects from being immediately deleted by way of being left in the old pack and then removed\&. Instead, the loose unreachable objects will be pruned according to normal expiry rules with the next
74 After packing, if the newly created packs make some existing packs redundant, remove the redundant packs\&. Also run
75 \fIgit prune\-packed\fR
76 to remove redundant loose object files\&.
84 is used\&. Then any unreachable objects are packed into a separate cruft pack\&. Unreachable objects can be pruned using the normal expiry rules with the next
87 \fBgit-gc\fR(1))\&. Incompatible with
91 \-\-cruft\-expiration=<approxidate>
93 Expire unreachable objects older than
95 immediately instead of waiting for the next
97 invocation\&. Only useful with
98 \fB\-\-cruft \-d\fR\&.
103 Write a cruft pack containing pruned objects (if any) to the directory
104 \fB<dir>\fR\&. This option is useful for keeping a copy of any pruned objects in a separate directory as a backup\&. Only useful with
105 \fB\-\-cruft \-d\fR\&.
113 \fIgit pack\-objects\fR\&. See
114 \fBgit-pack-objects\fR(1)\&.
120 \fB\-\-no\-reuse\-delta\fR
122 \fBgit\-pack\-objects\fR, see
123 \fBgit-pack-objects\fR(1)\&.
129 \fB\-\-no\-reuse\-object\fR
131 \fBgit\-pack\-objects\fR, see
132 \fBgit-pack-objects\fR(1)\&.
137 Show no progress over the standard error stream and pass the
140 \fIgit pack\-objects\fR\&. See
141 \fBgit-pack-objects\fR(1)\&.
146 Do not update the server information with
147 \fIgit update\-server\-info\fR\&. This option skips updating local catalog files needed to publish this repository (or a direct copy of it) over HTTP or FTP\&. See
148 \fBgit-update-server-info\fR(1)\&.
151 \-\-window=<n>, \-\-depth=<n>
153 These two options affect how the objects contained in the pack are stored using delta compression\&. The objects are first internally sorted by type, size and optionally names and compared against the other objects within
155 to see if using delta compression saves space\&.
157 limits the maximum delta depth; making it too deep affects the performance on the unpacker side, because delta data needs to be applied that many times to get to the necessary object\&.
159 The default value for \-\-window is 10 and \-\-depth is 50\&. The maximum depth is 4095\&.
164 This option is passed through to
165 \fBgit pack\-objects\fR\&.
168 \-\-window\-memory=<n>
170 This option provides an additional limit on top of
171 \fB\-\-window\fR; the window size will dynamically scale down so as to not take up more than
173 bytes in memory\&. This is useful in repositories with a mix of large and small objects to not run out of memory with a large window, but still be able to take advantage of the large window for the smaller objects\&. The size can be suffixed with "k", "m", or "g"\&.
174 \fB\-\-window\-memory=0\fR
175 makes memory usage unlimited\&. The default is taken from the
176 \fBpack\&.windowMemory\fR
177 configuration variable\&. Note that the actual memory usage will be the limit multiplied by the number of threads used by
178 \fBgit-pack-objects\fR(1)\&.
181 \-\-max\-pack\-size=<n>
183 Maximum size of each output pack file\&. The size can be suffixed with "k", "m", or "g"\&. The minimum size allowed is limited to 1 MiB\&. If specified, multiple packfiles may be created, which also prevents the creation of a bitmap index\&. The default is unlimited, unless the config variable
184 \fBpack\&.packSizeLimit\fR
185 is set\&. Note that this option may result in a larger and slower repository; see the discussion in
186 \fBpack\&.packSizeLimit\fR\&.
189 \-b, \-\-write\-bitmap\-index
191 Write a reachability bitmap index as part of the repack\&. This only makes sense when used with
195 \fB\-m\fR, as the bitmaps must be able to refer to all reachable objects\&. This option overrides the setting of
196 \fBrepack\&.writeBitmaps\fR\&. This option has no effect if multiple packfiles are created, unless writing a MIDX (in which case a multi\-pack bitmap is created)\&.
199 \-\-pack\-kept\-objects
203 files when repacking\&. Note that we still do not delete
207 finishes\&. This means that we may duplicate objects, but this makes the option safe to use when there are concurrent pushes or fetches\&. This option is generally only useful if you are writing bitmaps with
210 \fBrepack\&.writeBitmaps\fR, as it ensures that the bitmapped packfile has the necessary objects\&.
213 \-\-keep\-pack=<pack\-name>
215 Exclude the given pack from repacking\&. This is the equivalent of having
219 is the pack file name without leading directory (e\&.g\&.
220 \fBpack\-123\&.pack\fR)\&. The option could be specified multiple times to keep multiple packs\&.
223 \-\-unpack\-unreachable=<when>
225 When loosening unreachable objects, do not bother loosening any objects older than
226 \fB<when>\fR\&. This can be used to optimize out the write of any objects that would be immediately pruned by a follow\-up
230 \-k, \-\-keep\-unreachable
233 \fB\-ad\fR, any unreachable objects from existing packs will be appended to the end of the packfile instead of being removed\&. In addition, any unreachable loose objects will be packed (and their loose counterparts removed)\&.
236 \-i, \-\-delta\-islands
239 \fB\-\-delta\-islands\fR
241 \fBgit\-pack\-objects\fR, see
242 \fBgit-pack-objects\fR(1)\&.
245 \-g=<factor>, \-\-geometric=<factor>
247 Arrange resulting pack structure so that each successive pack contains at least
249 times the number of objects as the next\-largest pack\&.
252 ensures this by determining a "cut" of packfiles that need to be repacked into one in order to ensure a geometric progression\&. It picks the smallest set of packfiles such that as many of the larger packfiles (by count of objects contained in that pack) may be left intact\&.
254 Unlike other repack modes, the set of objects to pack is determined uniquely by the set of packs being "rolled\-up"; in other words, the packs determined to need to be combined in order to restore a geometric progression\&.
258 is specified, loose objects are implicitly included in this "roll\-up", without respect to their reachability\&. This is subject to change in the future\&. This option (implying a drastically different repack mode) is not guaranteed to work with all other combinations of option to
261 When writing a multi\-pack bitmap,
263 selects the largest resulting pack as the preferred pack for object selection by the MIDX (see
264 \fBgit-multi-pack-index\fR(1))\&.
269 Write a multi\-pack index (see
270 \fBgit-multi-pack-index\fR(1)) containing the non\-redundant packs\&.
274 Various configuration variables affect packing, see \fBgit-config\fR(1) (search for "pack" and "delta")\&.
276 By default, the command passes \fB\-\-delta\-base\-offset\fR option to \fIgit pack\-objects\fR; this typically results in slightly smaller packs, but the generated packs are incompatible with versions of Git older than version 1\&.4\&.4\&. If you need to share your repository with such ancient Git versions, either directly or via the dumb http protocol, then you need to set the configuration variable \fBrepack\&.UseDeltaBaseOffset\fR to "false" and repack\&. Access from old Git versions over the native protocol is unaffected by this option as the conversion is performed on the fly as needed in that case\&.
278 Delta compression is not used on objects larger than the \fBcore\&.bigFileThreshold\fR configuration variable and on files with the attribute \fBdelta\fR set to false\&.
281 \fBgit-pack-objects\fR(1) \fBgit-prune-packed\fR(1)
284 Part of the \fBgit\fR(1) suite