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.36.1.153.gf9b95943b6
10 .TH "GIT\-REPACK" "1" "05/20/2022" "Git 2\&.36\&.1\&.153\&.gf9b959" "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 \fIgit pack\-objects\fR\&. See
85 \fBgit-pack-objects\fR(1)\&.
91 \fB\-\-no\-reuse\-delta\fR
93 \fBgit\-pack\-objects\fR, see
94 \fBgit-pack-objects\fR(1)\&.
100 \fB\-\-no\-reuse\-object\fR
102 \fBgit\-pack\-objects\fR, see
103 \fBgit-pack-objects\fR(1)\&.
108 Show no progress over the standard error stream and pass the
111 \fIgit pack\-objects\fR\&. See
112 \fBgit-pack-objects\fR(1)\&.
117 Do not update the server information with
118 \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
119 \fBgit-update-server-info\fR(1)\&.
122 \-\-window=<n>, \-\-depth=<n>
124 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
126 to see if using delta compression saves space\&.
128 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\&.
130 The default value for \-\-window is 10 and \-\-depth is 50\&. The maximum depth is 4095\&.
135 This option is passed through to
136 \fBgit pack\-objects\fR\&.
139 \-\-window\-memory=<n>
141 This option provides an additional limit on top of
142 \fB\-\-window\fR; the window size will dynamically scale down so as to not take up more than
144 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"\&.
145 \fB\-\-window\-memory=0\fR
146 makes memory usage unlimited\&. The default is taken from the
147 \fBpack\&.windowMemory\fR
148 configuration variable\&. Note that the actual memory usage will be the limit multiplied by the number of threads used by
149 \fBgit-pack-objects\fR(1)\&.
152 \-\-max\-pack\-size=<n>
154 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
155 \fBpack\&.packSizeLimit\fR
156 is set\&. Note that this option may result in a larger and slower repository; see the discussion in
157 \fBpack\&.packSizeLimit\fR\&.
160 \-b, \-\-write\-bitmap\-index
162 Write a reachability bitmap index as part of the repack\&. This only makes sense when used with
166 \fB\-m\fR, as the bitmaps must be able to refer to all reachable objects\&. This option overrides the setting of
167 \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)\&.
170 \-\-pack\-kept\-objects
174 files when repacking\&. Note that we still do not delete
178 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
181 \fBrepack\&.writeBitmaps\fR, as it ensures that the bitmapped packfile has the necessary objects\&.
184 \-\-keep\-pack=<pack\-name>
186 Exclude the given pack from repacking\&. This is the equivalent of having
190 is the pack file name without leading directory (e\&.g\&.
191 \fBpack\-123\&.pack\fR)\&. The option could be specified multiple times to keep multiple packs\&.
194 \-\-unpack\-unreachable=<when>
196 When loosening unreachable objects, do not bother loosening any objects older than
197 \fB<when>\fR\&. This can be used to optimize out the write of any objects that would be immediately pruned by a follow\-up
201 \-k, \-\-keep\-unreachable
204 \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)\&.
207 \-i, \-\-delta\-islands
210 \fB\-\-delta\-islands\fR
212 \fBgit\-pack\-objects\fR, see
213 \fBgit-pack-objects\fR(1)\&.
216 \-g=<factor>, \-\-geometric=<factor>
218 Arrange resulting pack structure so that each successive pack contains at least
220 times the number of objects as the next\-largest pack\&.
223 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\&.
225 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\&.
229 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
232 When writing a multi\-pack bitmap,
234 selects the largest resulting pack as the preferred pack for object selection by the MIDX (see
235 \fBgit-multi-pack-index\fR(1))\&.
240 Write a multi\-pack index (see
241 \fBgit-multi-pack-index\fR(1)) containing the non\-redundant packs\&.
245 Various configuration variables affect packing, see \fBgit-config\fR(1) (search for "pack" and "delta")\&.
247 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\&.
249 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\&.
252 \fBgit-pack-objects\fR(1) \fBgit-prune-packed\fR(1)
255 Part of the \fBgit\fR(1) suite