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