]>
Commit | Line | Data |
---|---|---|
215a7ad1 JH |
1 | git-repack(1) |
2 | ============= | |
e31bb3bb JH |
3 | |
4 | NAME | |
5 | ---- | |
c3f0baac | 6 | git-repack - Pack unpacked objects in a repository |
e31bb3bb JH |
7 | |
8 | ||
9 | SYNOPSIS | |
10 | -------- | |
b1889c36 | 11 | 'git repack' [-a] [-A] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N] |
e31bb3bb JH |
12 | |
13 | DESCRIPTION | |
14 | ----------- | |
e31bb3bb | 15 | |
f85a4191 | 16 | This script is used to combine all objects that do not currently |
02783075 | 17 | reside in a "pack", into a pack. It can also be used to re-organize |
38d697a1 | 18 | existing packs into a single, more efficient pack. |
f85a4191 JH |
19 | |
20 | A pack is a collection of objects, individually compressed, with | |
21 | delta compression applied, stored in a single file, with an | |
22 | associated index file. | |
23 | ||
24 | Packs are used to reduce the load on mirror systems, backup | |
25 | engines, disk storage, etc. | |
26 | ||
27 | OPTIONS | |
28 | ------- | |
29 | ||
30 | -a:: | |
31 | Instead of incrementally packing the unpacked objects, | |
38d697a1 | 32 | pack everything referenced into a single pack. |
f85a4191 | 33 | Especially useful when packing a repository that is used |
9a8531ee | 34 | for private development. Use |
38d697a1 SV |
35 | with '-d'. This will clean up the objects that `git prune` |
36 | leaves behind, but `git fsck --full` shows as | |
37 | dangling. | |
9a8531ee MG |
38 | + |
39 | Note that users fetching over dumb protocols will have to fetch the | |
40 | whole new pack in order to get any contained object, no matter how many | |
41 | other objects in that pack they already have locally. | |
f85a4191 | 42 | |
bbefaa1f | 43 | -A:: |
83d0289d BC |
44 | Same as `-a`, unless '-d' is used. Then any unreachable |
45 | objects in a previous pack become loose, unpacked objects, | |
46 | instead of being left in the old pack. Unreachable objects | |
47 | are never intentionally added to a pack, even when repacking. | |
48 | This option prevents unreachable objects from being immediately | |
bbefaa1f CF |
49 | deleted by way of being left in the old pack and then |
50 | removed. Instead, the loose unreachable objects | |
51 | will be pruned according to normal expiry rules | |
0b444cdb | 52 | with the next 'git gc' invocation. See linkgit:git-gc[1]. |
bbefaa1f | 53 | |
f85a4191 JH |
54 | -d:: |
55 | After packing, if the newly created packs make some | |
56 | existing packs redundant, remove the redundant packs. | |
0b444cdb | 57 | Also run 'git prune-packed' to remove redundant |
483bc4f0 | 58 | loose object files. |
e31bb3bb | 59 | |
31f23281 | 60 | -l:: |
0b444cdb | 61 | Pass the `--local` option to 'git pack-objects'. See |
5162e697 | 62 | linkgit:git-pack-objects[1]. |
31f23281 | 63 | |
cec2be76 | 64 | -f:: |
8d11fdea | 65 | Pass the `--no-reuse-object` option to `git-pack-objects`, see |
5162e697 | 66 | linkgit:git-pack-objects[1]. |
cec2be76 JH |
67 | |
68 | -q:: | |
0b444cdb | 69 | Pass the `-q` option to 'git pack-objects'. See |
5162e697 | 70 | linkgit:git-pack-objects[1]. |
cec2be76 | 71 | |
31f23281 | 72 | -n:: |
c30f9936 | 73 | Do not update the server information with |
0b444cdb | 74 | 'git update-server-info'. This option skips |
c30f9936 SP |
75 | updating local catalog files needed to publish |
76 | this repository (or a direct copy of it) | |
0cafe944 | 77 | over HTTP or FTP. See linkgit:git-update-server-info[1]. |
e31bb3bb | 78 | |
3240240f SB |
79 | --window=[N]:: |
80 | --depth=[N]:: | |
3df19671 | 81 | These two options affect how the objects contained in the pack are |
02ac04fc JF |
82 | stored using delta compression. The objects are first internally |
83 | sorted by type, size and optionally names and compared against the | |
84 | other objects within `--window` to see if using delta compression saves | |
85 | space. `--depth` limits the maximum delta depth; making it too deep | |
86 | affects the performance on the unpacker side, because delta data needs | |
87 | to be applied that many times to get to the necessary object. | |
618e613a | 88 | The default value for --window is 10 and --depth is 50. |
02ac04fc | 89 | |
e93b15cd BD |
90 | --window-memory=[N]:: |
91 | This option provides an additional limit on top of `--window`; | |
92 | the window size will dynamically scale down so as to not take | |
93 | up more than N bytes in memory. This is useful in | |
94 | repositories with a mix of large and small objects to not run | |
95 | out of memory with a large window, but still be able to take | |
96 | advantage of the large window for the smaller objects. The | |
97 | size can be suffixed with "k", "m", or "g". | |
98 | `--window-memory=0` makes memory usage unlimited, which is the | |
99 | default. | |
100 | ||
07cf0f24 NP |
101 | --max-pack-size=[N]:: |
102 | Maximum size of each output pack file. The size can be suffixed with | |
103 | "k", "m", or "g". The minimum size allowed is limited to 1 MiB. | |
6b94b1a0 | 104 | If specified, multiple packfiles may be created. |
07cf0f24 NP |
105 | The default is unlimited, unless the config variable |
106 | `pack.packSizeLimit` is set. | |
6b94b1a0 | 107 | |
02ac04fc | 108 | |
b6945f57 JH |
109 | Configuration |
110 | ------------- | |
111 | ||
9f17688d NP |
112 | By default, the command passes `--delta-base-offset` option to |
113 | 'git pack-objects'; this typically results in slightly smaller packs, | |
114 | but the generated packs are incompatible with versions of Git older than | |
115 | version 1.4.4. If you need to share your repository with such ancient Git | |
116 | versions, either directly or via the dumb http or rsync protocol, then you | |
117 | need to set the configuration variable `repack.UseDeltaBaseOffset` to | |
118 | "false" and repack. Access from old Git versions over the native protocol | |
119 | is unaffected by this option as the conversion is performed on the fly | |
120 | as needed in that case. | |
b6945f57 JH |
121 | |
122 | ||
e31bb3bb JH |
123 | Author |
124 | ------ | |
125 | Written by Linus Torvalds <torvalds@osdl.org> | |
126 | ||
127 | Documentation | |
128 | -------------- | |
129 | Documentation by Ryan Anderson <ryan@michonline.com> | |
130 | ||
56ae8df5 | 131 | SEE ALSO |
e31bb3bb | 132 | -------- |
5162e697 DM |
133 | linkgit:git-pack-objects[1] |
134 | linkgit:git-prune-packed[1] | |
e31bb3bb JH |
135 | |
136 | GIT | |
137 | --- | |
9e1f0a85 | 138 | Part of the linkgit:git[1] suite |