Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 1 | git-repack(1) |
| 2 | ============= |
Junio C Hamano | e31bb3b | 2005-08-15 15:48:47 -0700 | [diff] [blame] | 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | c3f0baa | 2007-01-18 15:53:37 -0800 | [diff] [blame] | 6 | git-repack - Pack unpacked objects in a repository |
Junio C Hamano | e31bb3b | 2005-08-15 15:48:47 -0700 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Martin von Zweigbergk | 7791a1d | 2011-07-01 22:38:26 -0400 | [diff] [blame] | 11 | [verse] |
Vicent Marti | 5cf2741 | 2013-12-21 09:00:31 -0500 | [diff] [blame] | 12 | 'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [-b] [--window=<n>] [--depth=<n>] |
Junio C Hamano | e31bb3b | 2005-08-15 15:48:47 -0700 | [diff] [blame] | 13 | |
| 14 | DESCRIPTION |
| 15 | ----------- |
Junio C Hamano | e31bb3b | 2005-08-15 15:48:47 -0700 | [diff] [blame] | 16 | |
Stefan Beller | 35c1417 | 2013-10-19 01:25:22 +0200 | [diff] [blame] | 17 | This command is used to combine all objects that do not currently |
Brian Hetro | 0278307 | 2007-08-23 20:44:13 -0400 | [diff] [blame] | 18 | reside in a "pack", into a pack. It can also be used to re-organize |
Sam Vilain | 38d697a | 2007-06-30 20:56:12 +1200 | [diff] [blame] | 19 | existing packs into a single, more efficient pack. |
Junio C Hamano | e31bb3b | 2005-08-15 15:48:47 -0700 | [diff] [blame] | 20 | |
Junio C Hamano | f85a419 | 2005-08-29 17:21:06 -0700 | [diff] [blame] | 21 | A pack is a collection of objects, individually compressed, with |
| 22 | delta compression applied, stored in a single file, with an |
| 23 | associated index file. |
| 24 | |
| 25 | Packs are used to reduce the load on mirror systems, backup |
| 26 | engines, disk storage, etc. |
| 27 | |
| 28 | OPTIONS |
| 29 | ------- |
| 30 | |
| 31 | -a:: |
| 32 | Instead of incrementally packing the unpacked objects, |
Sam Vilain | 38d697a | 2007-06-30 20:56:12 +1200 | [diff] [blame] | 33 | pack everything referenced into a single pack. |
Junio C Hamano | f85a419 | 2005-08-29 17:21:06 -0700 | [diff] [blame] | 34 | Especially useful when packing a repository that is used |
Michael J Gruber | 9a8531e | 2009-06-09 18:15:47 +0200 | [diff] [blame] | 35 | for private development. Use |
Sam Vilain | 38d697a | 2007-06-30 20:56:12 +1200 | [diff] [blame] | 36 | with '-d'. This will clean up the objects that `git prune` |
Junio C Hamano | c6a13b2 | 2012-02-28 14:55:39 -0800 | [diff] [blame] | 37 | leaves behind, but `git fsck --full --dangling` shows as |
Sam Vilain | 38d697a | 2007-06-30 20:56:12 +1200 | [diff] [blame] | 38 | dangling. |
Michael J Gruber | 9a8531e | 2009-06-09 18:15:47 +0200 | [diff] [blame] | 39 | + |
| 40 | Note that users fetching over dumb protocols will have to fetch the |
| 41 | whole new pack in order to get any contained object, no matter how many |
| 42 | other objects in that pack they already have locally. |
Junio C Hamano | f85a419 | 2005-08-29 17:21:06 -0700 | [diff] [blame] | 43 | |
Chris Frey | bbefaa1 | 2008-05-15 22:37:31 -0400 | [diff] [blame] | 44 | -A:: |
Brandon Casey | 83d0289 | 2008-11-13 14:11:46 -0600 | [diff] [blame] | 45 | Same as `-a`, unless '-d' is used. Then any unreachable |
| 46 | objects in a previous pack become loose, unpacked objects, |
| 47 | instead of being left in the old pack. Unreachable objects |
| 48 | are never intentionally added to a pack, even when repacking. |
| 49 | This option prevents unreachable objects from being immediately |
Chris Frey | bbefaa1 | 2008-05-15 22:37:31 -0400 | [diff] [blame] | 50 | deleted by way of being left in the old pack and then |
| 51 | removed. Instead, the loose unreachable objects |
| 52 | will be pruned according to normal expiry rules |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 53 | with the next 'git gc' invocation. See linkgit:git-gc[1]. |
Chris Frey | bbefaa1 | 2008-05-15 22:37:31 -0400 | [diff] [blame] | 54 | |
Junio C Hamano | f85a419 | 2005-08-29 17:21:06 -0700 | [diff] [blame] | 55 | -d:: |
| 56 | After packing, if the newly created packs make some |
| 57 | existing packs redundant, remove the redundant packs. |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 58 | Also run 'git prune-packed' to remove redundant |
Jonathan Nieder | 483bc4f | 2008-06-30 13:56:34 -0500 | [diff] [blame] | 59 | loose object files. |
Junio C Hamano | f85a419 | 2005-08-29 17:21:06 -0700 | [diff] [blame] | 60 | |
Nikolai Weibull | 31f2328 | 2005-12-09 00:28:05 +0100 | [diff] [blame] | 61 | -l:: |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 62 | Pass the `--local` option to 'git pack-objects'. See |
Dan McGee | 5162e69 | 2007-12-29 00:20:38 -0600 | [diff] [blame] | 63 | linkgit:git-pack-objects[1]. |
Nikolai Weibull | 31f2328 | 2005-12-09 00:28:05 +0100 | [diff] [blame] | 64 | |
Junio C Hamano | cec2be7 | 2006-02-16 11:57:18 -0800 | [diff] [blame] | 65 | -f:: |
Jan Krüger | 5c47e1c | 2010-09-27 14:19:36 +0200 | [diff] [blame] | 66 | Pass the `--no-reuse-delta` option to `git-pack-objects`, see |
| 67 | linkgit:git-pack-objects[1]. |
| 68 | |
| 69 | -F:: |
Mikael Magnusson | 8d11fde | 2008-09-19 15:43:48 +0200 | [diff] [blame] | 70 | Pass the `--no-reuse-object` option to `git-pack-objects`, see |
Dan McGee | 5162e69 | 2007-12-29 00:20:38 -0600 | [diff] [blame] | 71 | linkgit:git-pack-objects[1]. |
Junio C Hamano | cec2be7 | 2006-02-16 11:57:18 -0800 | [diff] [blame] | 72 | |
| 73 | -q:: |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 74 | Pass the `-q` option to 'git pack-objects'. See |
Dan McGee | 5162e69 | 2007-12-29 00:20:38 -0600 | [diff] [blame] | 75 | linkgit:git-pack-objects[1]. |
Junio C Hamano | cec2be7 | 2006-02-16 11:57:18 -0800 | [diff] [blame] | 76 | |
Nikolai Weibull | 31f2328 | 2005-12-09 00:28:05 +0100 | [diff] [blame] | 77 | -n:: |
Shawn O. Pearce | c30f993 | 2008-05-22 08:47:19 -0400 | [diff] [blame] | 78 | Do not update the server information with |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 79 | 'git update-server-info'. This option skips |
Shawn O. Pearce | c30f993 | 2008-05-22 08:47:19 -0400 | [diff] [blame] | 80 | updating local catalog files needed to publish |
| 81 | this repository (or a direct copy of it) |
Jonathan Nieder | 0cafe94 | 2008-07-02 23:54:38 -0500 | [diff] [blame] | 82 | over HTTP or FTP. See linkgit:git-update-server-info[1]. |
Junio C Hamano | e31bb3b | 2005-08-15 15:48:47 -0700 | [diff] [blame] | 83 | |
Štěpán Němec | 62b4698 | 2010-10-08 19:31:15 +0200 | [diff] [blame] | 84 | --window=<n>:: |
| 85 | --depth=<n>:: |
Dennis Stosberg | 3df1967 | 2006-10-06 11:15:03 +0200 | [diff] [blame] | 86 | These two options affect how the objects contained in the pack are |
Jonas Fonseca | 02ac04f | 2006-09-17 13:02:59 +0200 | [diff] [blame] | 87 | stored using delta compression. The objects are first internally |
| 88 | sorted by type, size and optionally names and compared against the |
| 89 | other objects within `--window` to see if using delta compression saves |
| 90 | space. `--depth` limits the maximum delta depth; making it too deep |
| 91 | affects the performance on the unpacker side, because delta data needs |
| 92 | to be applied that many times to get to the necessary object. |
Theodore Ts'o | 618e613 | 2007-05-08 09:28:26 -0400 | [diff] [blame] | 93 | The default value for --window is 10 and --depth is 50. |
Jonas Fonseca | 02ac04f | 2006-09-17 13:02:59 +0200 | [diff] [blame] | 94 | |
Štěpán Němec | 62b4698 | 2010-10-08 19:31:15 +0200 | [diff] [blame] | 95 | --window-memory=<n>:: |
Brian Downing | e93b15c | 2007-07-12 07:55:52 -0500 | [diff] [blame] | 96 | This option provides an additional limit on top of `--window`; |
| 97 | the window size will dynamically scale down so as to not take |
Štěpán Němec | 62b4698 | 2010-10-08 19:31:15 +0200 | [diff] [blame] | 98 | up more than '<n>' bytes in memory. This is useful in |
Brian Downing | e93b15c | 2007-07-12 07:55:52 -0500 | [diff] [blame] | 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 | |
Štěpán Němec | 62b4698 | 2010-10-08 19:31:15 +0200 | [diff] [blame] | 106 | --max-pack-size=<n>:: |
Nicolas Pitre | 07cf0f2 | 2010-02-03 22:48:28 -0500 | [diff] [blame] | 107 | Maximum size of each output pack file. The size can be suffixed with |
| 108 | "k", "m", or "g". The minimum size allowed is limited to 1 MiB. |
Eric Wong | 9cea46c | 2016-04-28 07:28:55 +0000 | [diff] [blame] | 109 | If specified, multiple packfiles may be created, which also |
| 110 | prevents the creation of a bitmap index. |
Nicolas Pitre | 07cf0f2 | 2010-02-03 22:48:28 -0500 | [diff] [blame] | 111 | The default is unlimited, unless the config variable |
| 112 | `pack.packSizeLimit` is set. |
Dana L. How | 6b94b1a | 2007-05-13 12:47:09 -0700 | [diff] [blame] | 113 | |
Vicent Marti | 5cf2741 | 2013-12-21 09:00:31 -0500 | [diff] [blame] | 114 | -b:: |
| 115 | --write-bitmap-index:: |
| 116 | Write a reachability bitmap index as part of the repack. This |
| 117 | only makes sense when used with `-a` or `-A`, as the bitmaps |
| 118 | must be able to refer to all reachable objects. This option |
Eric Wong | 9cea46c | 2016-04-28 07:28:55 +0000 | [diff] [blame] | 119 | overrides the setting of `repack.writeBitmaps`. This option |
| 120 | has no effect if multiple packfiles are created. |
Vicent Marti | 5cf2741 | 2013-12-21 09:00:31 -0500 | [diff] [blame] | 121 | |
Jeff King | ee34a2b | 2014-03-03 15:04:20 -0500 | [diff] [blame] | 122 | --pack-kept-objects:: |
| 123 | Include objects in `.keep` files when repacking. Note that we |
| 124 | still do not delete `.keep` packs after `pack-objects` finishes. |
| 125 | This means that we may duplicate objects, but this makes the |
| 126 | option safe to use when there are concurrent pushes or fetches. |
| 127 | This option is generally only useful if you are writing bitmaps |
Eric Wong | 9cea46c | 2016-04-28 07:28:55 +0000 | [diff] [blame] | 128 | with `-b` or `repack.writeBitmaps`, as it ensures that the |
Jeff King | ee34a2b | 2014-03-03 15:04:20 -0500 | [diff] [blame] | 129 | bitmapped packfile has the necessary objects. |
Jonas Fonseca | 02ac04f | 2006-09-17 13:02:59 +0200 | [diff] [blame] | 130 | |
Junio C Hamano | b6945f5 | 2006-10-13 21:28:58 -0700 | [diff] [blame] | 131 | Configuration |
| 132 | ------------- |
| 133 | |
Nicolas Pitre | 9f17688 | 2010-02-04 16:19:35 -0500 | [diff] [blame] | 134 | By default, the command passes `--delta-base-offset` option to |
| 135 | 'git pack-objects'; this typically results in slightly smaller packs, |
| 136 | but the generated packs are incompatible with versions of Git older than |
| 137 | version 1.4.4. If you need to share your repository with such ancient Git |
Jeff King | 0d0bac6 | 2016-01-30 02:21:26 -0500 | [diff] [blame] | 138 | versions, either directly or via the dumb http protocol, then you |
Nicolas Pitre | 9f17688 | 2010-02-04 16:19:35 -0500 | [diff] [blame] | 139 | need to set the configuration variable `repack.UseDeltaBaseOffset` to |
| 140 | "false" and repack. Access from old Git versions over the native protocol |
| 141 | is unaffected by this option as the conversion is performed on the fly |
| 142 | as needed in that case. |
Junio C Hamano | b6945f5 | 2006-10-13 21:28:58 -0700 | [diff] [blame] | 143 | |
Junio C Hamano | 56ae8df | 2008-05-28 16:55:27 -0700 | [diff] [blame] | 144 | SEE ALSO |
Junio C Hamano | e31bb3b | 2005-08-15 15:48:47 -0700 | [diff] [blame] | 145 | -------- |
Dan McGee | 5162e69 | 2007-12-29 00:20:38 -0600 | [diff] [blame] | 146 | linkgit:git-pack-objects[1] |
| 147 | linkgit:git-prune-packed[1] |
Junio C Hamano | e31bb3b | 2005-08-15 15:48:47 -0700 | [diff] [blame] | 148 | |
| 149 | GIT |
| 150 | --- |
Christian Couder | 9e1f0a8 | 2008-06-06 09:07:32 +0200 | [diff] [blame] | 151 | Part of the linkgit:git[1] suite |