logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

git-repack.1 (13382B)


  1. '\" t
  2. .\" Title: git-repack
  3. .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
  5. .\" Date: 2025-03-14
  6. .\" Manual: Git Manual
  7. .\" Source: Git 2.49.0
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-REPACK" "1" "2025-03-14" "Git 2\&.49\&.0" "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. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. git-repack \- Pack unpacked objects in a repository
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit repack\fR [\-a] [\-A] [\-d] [\-f] [\-F] [\-l] [\-n] [\-q] [\-b] [\-m]
  36. [\-\-window=<n>] [\-\-depth=<n>] [\-\-threads=<n>] [\-\-keep\-pack=<pack\-name>]
  37. [\-\-write\-midx] [\-\-name\-hash\-version=<n>]
  38. .fi
  39. .SH "DESCRIPTION"
  40. .sp
  41. 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. .sp
  43. A pack is a collection of objects, individually compressed, with delta compression applied, stored in a single file, with an associated index file\&.
  44. .sp
  45. Packs are used to reduce the load on mirror systems, backup engines, disk storage, etc\&.
  46. .SH "OPTIONS"
  47. .PP
  48. \-a
  49. .RS 4
  50. 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
  51. \fB\-d\fR\&. This will clean up the objects that
  52. \fBgit\fR
  53. \fBprune\fR
  54. leaves behind, but
  55. \fBgit\fR
  56. \fBfsck\fR
  57. \fB\-\-full\fR
  58. \fB\-\-dangling\fR
  59. shows as dangling\&.
  60. .sp
  61. 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\&.
  62. .sp
  63. 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\&.
  64. .RE
  65. .PP
  66. \-A
  67. .RS 4
  68. Same as
  69. \fB\-a\fR, unless
  70. \fB\-d\fR
  71. 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
  72. \fIgit gc\fR
  73. invocation\&. See
  74. \fBgit-gc\fR(1)\&.
  75. .RE
  76. .PP
  77. \-d
  78. .RS 4
  79. After packing, if the newly created packs make some existing packs redundant, remove the redundant packs\&. Also run
  80. \fIgit prune\-packed\fR
  81. to remove redundant loose object files\&.
  82. .RE
  83. .PP
  84. \-\-cruft
  85. .RS 4
  86. Same as
  87. \fB\-a\fR, unless
  88. \fB\-d\fR
  89. 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
  90. \fBgit\fR
  91. \fBgc\fR
  92. invocation (see
  93. \fBgit-gc\fR(1))\&. Incompatible with
  94. \fB\-k\fR\&.
  95. .RE
  96. .PP
  97. \-\-cruft\-expiration=<approxidate>
  98. .RS 4
  99. Expire unreachable objects older than
  100. \fI<approxidate>\fR
  101. immediately instead of waiting for the next
  102. \fBgit\fR
  103. \fBgc\fR
  104. invocation\&. Only useful with
  105. \fB\-\-cruft\fR
  106. \fB\-d\fR\&.
  107. .RE
  108. .PP
  109. \-\-max\-cruft\-size=<n>
  110. .RS 4
  111. Repack cruft objects into packs as large as
  112. \fI<n>\fR
  113. bytes before creating new packs\&. As long as there are enough cruft packs smaller than
  114. \fI<n>\fR, repacking will cause a new cruft pack to be created containing objects from any combined cruft packs, along with any new unreachable objects\&. Cruft packs larger than
  115. \fI<n>\fR
  116. will not be modified\&. When the new cruft pack is larger than
  117. \fI<n>\fR
  118. bytes, it will be split into multiple packs, all of which are guaranteed to be at most
  119. \fI<n>\fR
  120. bytes in size\&. Only useful with
  121. \fB\-\-cruft\fR
  122. \fB\-d\fR\&.
  123. .RE
  124. .PP
  125. \-\-expire\-to=<dir>
  126. .RS 4
  127. Write a cruft pack containing pruned objects (if any) to the directory
  128. \fI<dir>\fR\&. This option is useful for keeping a copy of any pruned objects in a separate directory as a backup\&. Only useful with
  129. \fB\-\-cruft\fR
  130. \fB\-d\fR\&.
  131. .RE
  132. .PP
  133. \-l
  134. .RS 4
  135. Pass the
  136. \fB\-\-local\fR
  137. option to
  138. \fIgit pack\-objects\fR\&. See
  139. \fBgit-pack-objects\fR(1)\&.
  140. .RE
  141. .PP
  142. \-f
  143. .RS 4
  144. Pass the
  145. \fB\-\-no\-reuse\-delta\fR
  146. option to
  147. \fBgit\-pack\-objects\fR, see
  148. \fBgit-pack-objects\fR(1)\&.
  149. .RE
  150. .PP
  151. \-F
  152. .RS 4
  153. Pass the
  154. \fB\-\-no\-reuse\-object\fR
  155. option to
  156. \fBgit\-pack\-objects\fR, see
  157. \fBgit-pack-objects\fR(1)\&.
  158. .RE
  159. .PP
  160. \-q, \-\-quiet
  161. .RS 4
  162. Show no progress over the standard error stream and pass the
  163. \fB\-q\fR
  164. option to
  165. \fIgit pack\-objects\fR\&. See
  166. \fBgit-pack-objects\fR(1)\&.
  167. .RE
  168. .PP
  169. \-n
  170. .RS 4
  171. Do not update the server information with
  172. \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
  173. \fBgit-update-server-info\fR(1)\&.
  174. .RE
  175. .PP
  176. \-\-window=<n>, \-\-depth=<n>
  177. .RS 4
  178. 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
  179. \fB\-\-window\fR
  180. to see if using delta compression saves space\&.
  181. \fB\-\-depth\fR
  182. 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\&.
  183. .sp
  184. The default value for \-\-window is 10 and \-\-depth is 50\&. The maximum depth is 4095\&.
  185. .RE
  186. .PP
  187. \-\-threads=<n>
  188. .RS 4
  189. This option is passed through to
  190. \fBgit\fR
  191. \fBpack\-objects\fR\&.
  192. .RE
  193. .PP
  194. \-\-window\-memory=<n>
  195. .RS 4
  196. This option provides an additional limit on top of
  197. \fB\-\-window\fR; the window size will dynamically scale down so as to not take up more than
  198. \fI<n>\fR
  199. 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"\&.
  200. \fB\-\-window\-memory=0\fR
  201. makes memory usage unlimited\&. The default is taken from the
  202. \fBpack\&.windowMemory\fR
  203. configuration variable\&. Note that the actual memory usage will be the limit multiplied by the number of threads used by
  204. \fBgit-pack-objects\fR(1)\&.
  205. .RE
  206. .PP
  207. \-\-max\-pack\-size=<n>
  208. .RS 4
  209. 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
  210. \fBpack\&.packSizeLimit\fR
  211. is set\&. Note that this option may result in a larger and slower repository; see the discussion in
  212. \fBpack\&.packSizeLimit\fR\&.
  213. .RE
  214. .PP
  215. \-\-filter=<filter\-spec>
  216. .RS 4
  217. Remove objects matching the filter specification from the resulting packfile and put them into a separate packfile\&. Note that objects used in the working directory are not filtered out\&. So for the split to fully work, it\(cqs best to perform it in a bare repo and to use the
  218. \fB\-a\fR
  219. and
  220. \fB\-d\fR
  221. options along with this option\&. Also
  222. \fB\-\-no\-write\-bitmap\-index\fR
  223. (or the
  224. \fBrepack\&.writebitmaps\fR
  225. config option set to
  226. \fBfalse\fR) should be used otherwise writing bitmap index will fail, as it supposes a single packfile containing all the objects\&. See
  227. \fBgit-rev-list\fR(1)
  228. for valid
  229. \fI<filter\-spec>\fR
  230. forms\&.
  231. .RE
  232. .PP
  233. \-\-filter\-to=<dir>
  234. .RS 4
  235. Write the pack containing filtered out objects to the directory
  236. \fI<dir>\fR\&. Only useful with
  237. \fB\-\-filter\fR\&. This can be used for putting the pack on a separate object directory that is accessed through the Git alternates mechanism\&.
  238. \fBWARNING:\fR
  239. If the packfile containing the filtered out objects is not accessible, the repo can become corrupt as it might not be possible to access the objects in that packfile\&. See the
  240. \fBobjects\fR
  241. and
  242. \fBobjects/info/alternates\fR
  243. sections of
  244. \fBgitrepository-layout\fR(5)\&.
  245. .RE
  246. .PP
  247. \-b, \-\-write\-bitmap\-index
  248. .RS 4
  249. Write a reachability bitmap index as part of the repack\&. This only makes sense when used with
  250. \fB\-a\fR,
  251. \fB\-A\fR
  252. or
  253. \fB\-m\fR, as the bitmaps must be able to refer to all reachable objects\&. This option overrides the setting of
  254. \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)\&.
  255. .RE
  256. .PP
  257. \-\-pack\-kept\-objects
  258. .RS 4
  259. Include objects in \&.\fBkeep\fR
  260. files when repacking\&. Note that we still do not delete \&.\fBkeep\fR
  261. packs after
  262. \fBpack\-objects\fR
  263. 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
  264. \fB\-b\fR
  265. or
  266. \fBrepack\&.writeBitmaps\fR, as it ensures that the bitmapped packfile has the necessary objects\&.
  267. .RE
  268. .PP
  269. \-\-keep\-pack=<pack\-name>
  270. .RS 4
  271. Exclude the given pack from repacking\&. This is the equivalent of having \&.\fBkeep\fR
  272. file on the pack\&.
  273. \fI<pack\-name>\fR
  274. is the pack file name without leading directory (e\&.g\&.
  275. \fBpack\-123\&.pack\fR)\&. The option can be specified multiple times to keep multiple packs\&.
  276. .RE
  277. .PP
  278. \-\-unpack\-unreachable=<when>
  279. .RS 4
  280. When loosening unreachable objects, do not bother loosening any objects older than
  281. \fI<when>\fR\&. This can be used to optimize out the write of any objects that would be immediately pruned by a follow\-up
  282. \fBgit\fR
  283. \fBprune\fR\&.
  284. .RE
  285. .PP
  286. \-k, \-\-keep\-unreachable
  287. .RS 4
  288. When used with
  289. \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)\&.
  290. .RE
  291. .PP
  292. \-i, \-\-delta\-islands
  293. .RS 4
  294. Pass the
  295. \fB\-\-delta\-islands\fR
  296. option to
  297. \fBgit\-pack\-objects\fR, see
  298. \fBgit-pack-objects\fR(1)\&.
  299. .RE
  300. .PP
  301. \-g<factor>, \-\-geometric=<factor>
  302. .RS 4
  303. Arrange resulting pack structure so that each successive pack contains at least
  304. \fI<factor>\fR
  305. times the number of objects as the next\-largest pack\&.
  306. .sp
  307. \fBgit\fR
  308. \fBrepack\fR
  309. 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\&.
  310. .sp
  311. 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\&.
  312. .sp
  313. Loose objects are implicitly included in this "roll\-up", without respect to their reachability\&. This is subject to change in the future\&.
  314. .sp
  315. When writing a multi\-pack bitmap,
  316. \fBgit\fR
  317. \fBrepack\fR
  318. selects the largest resulting pack as the preferred pack for object selection by the MIDX (see
  319. \fBgit-multi-pack-index\fR(1))\&.
  320. .RE
  321. .PP
  322. \-m, \-\-write\-midx
  323. .RS 4
  324. Write a multi\-pack index (see
  325. \fBgit-multi-pack-index\fR(1)) containing the non\-redundant packs\&.
  326. .RE
  327. .PP
  328. \-\-name\-hash\-version=<n>
  329. .RS 4
  330. Provide this argument to the underlying
  331. \fBgit\fR
  332. \fBpack\-objects\fR
  333. process\&. See
  334. \fBgit-pack-objects\fR(1)
  335. for full details\&.
  336. .RE
  337. .SH "CONFIGURATION"
  338. .sp
  339. Various configuration variables affect packing, see \fBgit-config\fR(1) (search for "pack" and "delta")\&.
  340. .sp
  341. 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\&.
  342. .sp
  343. 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\&.
  344. .SH "SEE ALSO"
  345. .sp
  346. \fBgit-pack-objects\fR(1) \fBgit-prune-packed\fR(1)
  347. .SH "GIT"
  348. .sp
  349. Part of the \fBgit\fR(1) suite