]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-repack.txt
git-format-patch(1): fix stray \ in output
[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--------
b1889c36 11'git repack' [-a] [-A] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N]
e31bb3bb
JH
12
13DESCRIPTION
14-----------
e31bb3bb 15
f85a4191 16This script is used to combine all objects that do not currently
02783075 17reside in a "pack", into a pack. It can also be used to re-organize
38d697a1 18existing packs into a single, more efficient pack.
f85a4191
JH
19
20A pack is a collection of objects, individually compressed, with
21delta compression applied, stored in a single file, with an
22associated index file.
23
24Packs are used to reduce the load on mirror systems, backup
25engines, disk storage, etc.
26
27OPTIONS
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
CF
40-A::
41 Same as `-a`, but any unreachable objects in a previous
42 pack become loose, unpacked objects, instead of being
43 left in the old pack. Unreachable objects are never
44 intentionally added to a pack, even when repacking.
45 When used with '-d', this option
46 prevents unreachable objects from being immediately
47 deleted by way of being left in the old pack and then
48 removed. Instead, the loose unreachable objects
49 will be pruned according to normal expiry rules
483bc4f0 50 with the next `git-gc` invocation. See linkgit:git-gc[1].
bbefaa1f 51
f85a4191
JH
52-d::
53 After packing, if the newly created packs make some
54 existing packs redundant, remove the redundant packs.
483bc4f0
JN
55 Also run `git-prune-packed` to remove redundant
56 loose object files.
e31bb3bb 57
31f23281 58-l::
483bc4f0 59 Pass the `--local` option to `git-pack-objects`. See
5162e697 60 linkgit:git-pack-objects[1].
31f23281 61
cec2be76 62-f::
483bc4f0 63 Pass the `--no-reuse-delta` option to `git-pack-objects`. See
5162e697 64 linkgit:git-pack-objects[1].
cec2be76
JH
65
66-q::
483bc4f0 67 Pass the `-q` option to `git-pack-objects`. See
5162e697 68 linkgit:git-pack-objects[1].
cec2be76 69
31f23281 70-n::
c30f9936 71 Do not update the server information with
b1889c36 72 `git-update-server-info`. This option skips
c30f9936
SP
73 updating local catalog files needed to publish
74 this repository (or a direct copy of it)
75 over HTTP or FTP. See gitlink:git-update-server-info[1].
e31bb3bb 76
3240240f
SB
77--window=[N]::
78--depth=[N]::
3df19671 79 These two options affect how the objects contained in the pack are
02ac04fc
JF
80 stored using delta compression. The objects are first internally
81 sorted by type, size and optionally names and compared against the
82 other objects within `--window` to see if using delta compression saves
83 space. `--depth` limits the maximum delta depth; making it too deep
84 affects the performance on the unpacker side, because delta data needs
85 to be applied that many times to get to the necessary object.
618e613a 86 The default value for --window is 10 and --depth is 50.
02ac04fc 87
e93b15cd
BD
88--window-memory=[N]::
89 This option provides an additional limit on top of `--window`;
90 the window size will dynamically scale down so as to not take
91 up more than N bytes in memory. This is useful in
92 repositories with a mix of large and small objects to not run
93 out of memory with a large window, but still be able to take
94 advantage of the large window for the smaller objects. The
95 size can be suffixed with "k", "m", or "g".
96 `--window-memory=0` makes memory usage unlimited, which is the
97 default.
98
6b94b1a0
DH
99--max-pack-size=<n>::
100 Maximum size of each output packfile, expressed in MiB.
101 If specified, multiple packfiles may be created.
102 The default is unlimited.
103
02ac04fc 104
b6945f57
JH
105Configuration
106-------------
107
108When configuration variable `repack.UseDeltaBaseOffset` is set
109for the repository, the command passes `--delta-base-offset`
110option to `git-pack-objects`; this typically results in slightly
111smaller packs, but the generated packs are incompatible with
112versions of git older than (and including) v1.4.3; do not set
113the variable in a repository that older version of git needs to
114be able to read (this includes repositories from which packs can
115be copied out over http or rsync, and people who obtained packs
116that way can try to use older git with it).
117
118
e31bb3bb
JH
119Author
120------
121Written by Linus Torvalds <torvalds@osdl.org>
122
123Documentation
124--------------
125Documentation by Ryan Anderson <ryan@michonline.com>
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