]>
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 |
b4f020c5 | 34 | for private development and there is no need to worry |
38d697a1 SV |
35 | about people fetching via dumb protocols from it. Use |
36 | with '-d'. This will clean up the objects that `git prune` | |
37 | leaves behind, but `git fsck --full` shows as | |
38 | dangling. | |
f85a4191 | 39 | |
bbefaa1f | 40 | -A:: |
83d0289d BC |
41 | Same as `-a`, unless '-d' is used. Then any unreachable |
42 | objects in a previous pack become loose, unpacked objects, | |
43 | instead of being left in the old pack. Unreachable objects | |
44 | are never intentionally added to a pack, even when repacking. | |
45 | This option prevents unreachable objects from being immediately | |
bbefaa1f CF |
46 | deleted by way of being left in the old pack and then |
47 | removed. Instead, the loose unreachable objects | |
48 | will be pruned according to normal expiry rules | |
ba020ef5 | 49 | with the next 'git-gc' invocation. See linkgit:git-gc[1]. |
bbefaa1f | 50 | |
f85a4191 JH |
51 | -d:: |
52 | After packing, if the newly created packs make some | |
53 | existing packs redundant, remove the redundant packs. | |
ba020ef5 | 54 | Also run 'git-prune-packed' to remove redundant |
483bc4f0 | 55 | loose object files. |
e31bb3bb | 56 | |
31f23281 | 57 | -l:: |
ba020ef5 | 58 | Pass the `--local` option to 'git-pack-objects'. See |
5162e697 | 59 | linkgit:git-pack-objects[1]. |
31f23281 | 60 | |
cec2be76 | 61 | -f:: |
8d11fdea | 62 | Pass the `--no-reuse-object` option to `git-pack-objects`, see |
5162e697 | 63 | linkgit:git-pack-objects[1]. |
cec2be76 JH |
64 | |
65 | -q:: | |
ba020ef5 | 66 | Pass the `-q` option to 'git-pack-objects'. See |
5162e697 | 67 | linkgit:git-pack-objects[1]. |
cec2be76 | 68 | |
31f23281 | 69 | -n:: |
c30f9936 | 70 | Do not update the server information with |
ba020ef5 | 71 | 'git-update-server-info'. This option skips |
c30f9936 SP |
72 | updating local catalog files needed to publish |
73 | this repository (or a direct copy of it) | |
0cafe944 | 74 | over HTTP or FTP. See linkgit:git-update-server-info[1]. |
e31bb3bb | 75 | |
3240240f SB |
76 | --window=[N]:: |
77 | --depth=[N]:: | |
3df19671 | 78 | These two options affect how the objects contained in the pack are |
02ac04fc JF |
79 | stored using delta compression. The objects are first internally |
80 | sorted by type, size and optionally names and compared against the | |
81 | other objects within `--window` to see if using delta compression saves | |
82 | space. `--depth` limits the maximum delta depth; making it too deep | |
83 | affects the performance on the unpacker side, because delta data needs | |
84 | to be applied that many times to get to the necessary object. | |
618e613a | 85 | The default value for --window is 10 and --depth is 50. |
02ac04fc | 86 | |
e93b15cd BD |
87 | --window-memory=[N]:: |
88 | This option provides an additional limit on top of `--window`; | |
89 | the window size will dynamically scale down so as to not take | |
90 | up more than N bytes in memory. This is useful in | |
91 | repositories with a mix of large and small objects to not run | |
92 | out of memory with a large window, but still be able to take | |
93 | advantage of the large window for the smaller objects. The | |
94 | size can be suffixed with "k", "m", or "g". | |
95 | `--window-memory=0` makes memory usage unlimited, which is the | |
96 | default. | |
97 | ||
6b94b1a0 DH |
98 | --max-pack-size=<n>:: |
99 | Maximum size of each output packfile, expressed in MiB. | |
100 | If specified, multiple packfiles may be created. | |
101 | The default is unlimited. | |
102 | ||
02ac04fc | 103 | |
b6945f57 JH |
104 | Configuration |
105 | ------------- | |
106 | ||
107 | When configuration variable `repack.UseDeltaBaseOffset` is set | |
108 | for the repository, the command passes `--delta-base-offset` | |
ba020ef5 | 109 | option to 'git-pack-objects'; this typically results in slightly |
b6945f57 JH |
110 | smaller packs, but the generated packs are incompatible with |
111 | versions of git older than (and including) v1.4.3; do not set | |
112 | the variable in a repository that older version of git needs to | |
113 | be able to read (this includes repositories from which packs can | |
114 | be copied out over http or rsync, and people who obtained packs | |
115 | that way can try to use older git with it). | |
116 | ||
117 | ||
e31bb3bb JH |
118 | Author |
119 | ------ | |
120 | Written by Linus Torvalds <torvalds@osdl.org> | |
121 | ||
122 | Documentation | |
123 | -------------- | |
124 | Documentation by Ryan Anderson <ryan@michonline.com> | |
125 | ||
56ae8df5 | 126 | SEE ALSO |
e31bb3bb | 127 | -------- |
5162e697 DM |
128 | linkgit:git-pack-objects[1] |
129 | linkgit:git-prune-packed[1] | |
e31bb3bb JH |
130 | |
131 | GIT | |
132 | --- | |
9e1f0a85 | 133 | Part of the linkgit:git[1] suite |