]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-repack.txt
Update draft release notes to 1.7.10
[thirdparty/git.git] / Documentation / git-repack.txt
CommitLineData
215a7ad1
JH
1git-repack(1)
2=============
e31bb3bb
JH
3
4NAME
5----
c3f0baac 6git-repack - Pack unpacked objects in a repository
e31bb3bb
JH
7
8
9SYNOPSIS
10--------
7791a1d9 11[verse]
d4c43697 12'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [--window=<n>] [--depth=<n>]
e31bb3bb
JH
13
14DESCRIPTION
15-----------
e31bb3bb 16
f85a4191 17This script is used to combine all objects that do not currently
02783075 18reside in a "pack", into a pack. It can also be used to re-organize
38d697a1 19existing packs into a single, more efficient pack.
f85a4191
JH
20
21A pack is a collection of objects, individually compressed, with
22delta compression applied, stored in a single file, with an
23associated index file.
24
25Packs are used to reduce the load on mirror systems, backup
26engines, disk storage, etc.
27
28OPTIONS
29-------
30
31-a::
32 Instead of incrementally packing the unpacked objects,
38d697a1 33 pack everything referenced into a single pack.
f85a4191 34 Especially useful when packing a repository that is used
9a8531ee 35 for private development. Use
38d697a1
SV
36 with '-d'. This will clean up the objects that `git prune`
37 leaves behind, but `git fsck --full` shows as
38 dangling.
9a8531ee
MG
39+
40Note that users fetching over dumb protocols will have to fetch the
41whole new pack in order to get any contained object, no matter how many
42other objects in that pack they already have locally.
f85a4191 43
bbefaa1f 44-A::
83d0289d
BC
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
bbefaa1f
CF
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
0b444cdb 53 with the next 'git gc' invocation. See linkgit:git-gc[1].
bbefaa1f 54
f85a4191
JH
55-d::
56 After packing, if the newly created packs make some
57 existing packs redundant, remove the redundant packs.
0b444cdb 58 Also run 'git prune-packed' to remove redundant
483bc4f0 59 loose object files.
e31bb3bb 60
31f23281 61-l::
0b444cdb 62 Pass the `--local` option to 'git pack-objects'. See
5162e697 63 linkgit:git-pack-objects[1].
31f23281 64
cec2be76 65-f::
5c47e1c7
JK
66 Pass the `--no-reuse-delta` option to `git-pack-objects`, see
67 linkgit:git-pack-objects[1].
68
69-F::
8d11fdea 70 Pass the `--no-reuse-object` option to `git-pack-objects`, see
5162e697 71 linkgit:git-pack-objects[1].
cec2be76
JH
72
73-q::
0b444cdb 74 Pass the `-q` option to 'git pack-objects'. See
5162e697 75 linkgit:git-pack-objects[1].
cec2be76 76
31f23281 77-n::
c30f9936 78 Do not update the server information with
0b444cdb 79 'git update-server-info'. This option skips
c30f9936
SP
80 updating local catalog files needed to publish
81 this repository (or a direct copy of it)
0cafe944 82 over HTTP or FTP. See linkgit:git-update-server-info[1].
e31bb3bb 83
62b4698e
ŠN
84--window=<n>::
85--depth=<n>::
3df19671 86 These two options affect how the objects contained in the pack are
02ac04fc
JF
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.
618e613a 93 The default value for --window is 10 and --depth is 50.
02ac04fc 94
62b4698e 95--window-memory=<n>::
e93b15cd
BD
96 This option provides an additional limit on top of `--window`;
97 the window size will dynamically scale down so as to not take
62b4698e 98 up more than '<n>' bytes in memory. This is useful in
e93b15cd
BD
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
62b4698e 106--max-pack-size=<n>::
07cf0f24
NP
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.
6b94b1a0 109 If specified, multiple packfiles may be created.
07cf0f24
NP
110 The default is unlimited, unless the config variable
111 `pack.packSizeLimit` is set.
6b94b1a0 112
02ac04fc 113
b6945f57
JH
114Configuration
115-------------
116
9f17688d
NP
117By default, the command passes `--delta-base-offset` option to
118'git pack-objects'; this typically results in slightly smaller packs,
119but the generated packs are incompatible with versions of Git older than
120version 1.4.4. If you need to share your repository with such ancient Git
121versions, either directly or via the dumb http or rsync protocol, then you
122need to set the configuration variable `repack.UseDeltaBaseOffset` to
123"false" and repack. Access from old Git versions over the native protocol
124is unaffected by this option as the conversion is performed on the fly
125as needed in that case.
b6945f57 126
56ae8df5 127SEE ALSO
e31bb3bb 128--------
5162e697
DM
129linkgit:git-pack-objects[1]
130linkgit:git-prune-packed[1]
e31bb3bb
JH
131
132GIT
133---
9e1f0a85 134Part of the linkgit:git[1] suite