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