blob: b9c02ce48134dd44b05053275ec4b219f3999091 [file] [log] [blame]
Junio C Hamano215a7ad2005-09-07 17:26:23 -07001git-repack(1)
2=============
Junio C Hamanoe31bb3b2005-08-15 15:48:47 -07003
4NAME
5----
Junio C Hamanoc3f0baa2007-01-18 15:53:37 -08006git-repack - Pack unpacked objects in a repository
Junio C Hamanoe31bb3b2005-08-15 15:48:47 -07007
8
9SYNOPSIS
10--------
Martin von Zweigbergk7791a1d2011-07-01 22:38:26 -040011[verse]
Vicent Marti5cf27412013-12-21 09:00:31 -050012'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [-b] [--window=<n>] [--depth=<n>]
Junio C Hamanoe31bb3b2005-08-15 15:48:47 -070013
14DESCRIPTION
15-----------
Junio C Hamanoe31bb3b2005-08-15 15:48:47 -070016
Stefan Beller35c14172013-10-19 01:25:22 +020017This command is used to combine all objects that do not currently
Brian Hetro02783072007-08-23 20:44:13 -040018reside in a "pack", into a pack. It can also be used to re-organize
Sam Vilain38d697a2007-06-30 20:56:12 +120019existing packs into a single, more efficient pack.
Junio C Hamanoe31bb3b2005-08-15 15:48:47 -070020
Junio C Hamanof85a4192005-08-29 17:21:06 -070021A 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,
Sam Vilain38d697a2007-06-30 20:56:12 +120033 pack everything referenced into a single pack.
Junio C Hamanof85a4192005-08-29 17:21:06 -070034 Especially useful when packing a repository that is used
Michael J Gruber9a8531e2009-06-09 18:15:47 +020035 for private development. Use
Sam Vilain38d697a2007-06-30 20:56:12 +120036 with '-d'. This will clean up the objects that `git prune`
Junio C Hamanoc6a13b22012-02-28 14:55:39 -080037 leaves behind, but `git fsck --full --dangling` shows as
Sam Vilain38d697a2007-06-30 20:56:12 +120038 dangling.
Michael J Gruber9a8531e2009-06-09 18:15:47 +020039+
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.
Junio C Hamanof85a4192005-08-29 17:21:06 -070043
Chris Freybbefaa12008-05-15 22:37:31 -040044-A::
Brandon Casey83d02892008-11-13 14:11:46 -060045 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
Chris Freybbefaa12008-05-15 22:37:31 -040050 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
Thomas Rast0b444cd2010-01-10 00:33:00 +010053 with the next 'git gc' invocation. See linkgit:git-gc[1].
Chris Freybbefaa12008-05-15 22:37:31 -040054
Junio C Hamanof85a4192005-08-29 17:21:06 -070055-d::
56 After packing, if the newly created packs make some
57 existing packs redundant, remove the redundant packs.
Thomas Rast0b444cd2010-01-10 00:33:00 +010058 Also run 'git prune-packed' to remove redundant
Jonathan Nieder483bc4f2008-06-30 13:56:34 -050059 loose object files.
Junio C Hamanof85a4192005-08-29 17:21:06 -070060
Nikolai Weibull31f23282005-12-09 00:28:05 +010061-l::
Thomas Rast0b444cd2010-01-10 00:33:00 +010062 Pass the `--local` option to 'git pack-objects'. See
Dan McGee5162e692007-12-29 00:20:38 -060063 linkgit:git-pack-objects[1].
Nikolai Weibull31f23282005-12-09 00:28:05 +010064
Junio C Hamanocec2be72006-02-16 11:57:18 -080065-f::
Jan Krüger5c47e1c2010-09-27 14:19:36 +020066 Pass the `--no-reuse-delta` option to `git-pack-objects`, see
67 linkgit:git-pack-objects[1].
68
69-F::
Mikael Magnusson8d11fde2008-09-19 15:43:48 +020070 Pass the `--no-reuse-object` option to `git-pack-objects`, see
Dan McGee5162e692007-12-29 00:20:38 -060071 linkgit:git-pack-objects[1].
Junio C Hamanocec2be72006-02-16 11:57:18 -080072
73-q::
Thomas Rast0b444cd2010-01-10 00:33:00 +010074 Pass the `-q` option to 'git pack-objects'. See
Dan McGee5162e692007-12-29 00:20:38 -060075 linkgit:git-pack-objects[1].
Junio C Hamanocec2be72006-02-16 11:57:18 -080076
Nikolai Weibull31f23282005-12-09 00:28:05 +010077-n::
Shawn O. Pearcec30f9932008-05-22 08:47:19 -040078 Do not update the server information with
Thomas Rast0b444cd2010-01-10 00:33:00 +010079 'git update-server-info'. This option skips
Shawn O. Pearcec30f9932008-05-22 08:47:19 -040080 updating local catalog files needed to publish
81 this repository (or a direct copy of it)
Jonathan Nieder0cafe942008-07-02 23:54:38 -050082 over HTTP or FTP. See linkgit:git-update-server-info[1].
Junio C Hamanoe31bb3b2005-08-15 15:48:47 -070083
Štěpán Němec62b46982010-10-08 19:31:15 +020084--window=<n>::
85--depth=<n>::
Dennis Stosberg3df19672006-10-06 11:15:03 +020086 These two options affect how the objects contained in the pack are
Jonas Fonseca02ac04f2006-09-17 13:02:59 +020087 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.
Theodore Ts'o618e6132007-05-08 09:28:26 -040093 The default value for --window is 10 and --depth is 50.
Jonas Fonseca02ac04f2006-09-17 13:02:59 +020094
Štěpán Němec62b46982010-10-08 19:31:15 +020095--window-memory=<n>::
Brian Downinge93b15c2007-07-12 07:55:52 -050096 This option provides an additional limit on top of `--window`;
97 the window size will dynamically scale down so as to not take
Štěpán Němec62b46982010-10-08 19:31:15 +020098 up more than '<n>' bytes in memory. This is useful in
Brian Downinge93b15c2007-07-12 07:55:52 -050099 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
Štěpán Němec62b46982010-10-08 19:31:15 +0200106--max-pack-size=<n>::
Nicolas Pitre07cf0f22010-02-03 22:48:28 -0500107 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.
Eric Wong9cea46c2016-04-28 07:28:55 +0000109 If specified, multiple packfiles may be created, which also
110 prevents the creation of a bitmap index.
Nicolas Pitre07cf0f22010-02-03 22:48:28 -0500111 The default is unlimited, unless the config variable
112 `pack.packSizeLimit` is set.
Dana L. How6b94b1a2007-05-13 12:47:09 -0700113
Vicent Marti5cf27412013-12-21 09:00:31 -0500114-b::
115--write-bitmap-index::
116 Write a reachability bitmap index as part of the repack. This
117 only makes sense when used with `-a` or `-A`, as the bitmaps
118 must be able to refer to all reachable objects. This option
Eric Wong9cea46c2016-04-28 07:28:55 +0000119 overrides the setting of `repack.writeBitmaps`. This option
120 has no effect if multiple packfiles are created.
Vicent Marti5cf27412013-12-21 09:00:31 -0500121
Jeff Kingee34a2b2014-03-03 15:04:20 -0500122--pack-kept-objects::
123 Include objects in `.keep` files when repacking. Note that we
124 still do not delete `.keep` packs after `pack-objects` finishes.
125 This means that we may duplicate objects, but this makes the
126 option safe to use when there are concurrent pushes or fetches.
127 This option is generally only useful if you are writing bitmaps
Eric Wong9cea46c2016-04-28 07:28:55 +0000128 with `-b` or `repack.writeBitmaps`, as it ensures that the
Jeff Kingee34a2b2014-03-03 15:04:20 -0500129 bitmapped packfile has the necessary objects.
Jonas Fonseca02ac04f2006-09-17 13:02:59 +0200130
Junio C Hamanob6945f52006-10-13 21:28:58 -0700131Configuration
132-------------
133
Nicolas Pitre9f176882010-02-04 16:19:35 -0500134By default, the command passes `--delta-base-offset` option to
135'git pack-objects'; this typically results in slightly smaller packs,
136but the generated packs are incompatible with versions of Git older than
137version 1.4.4. If you need to share your repository with such ancient Git
Jeff King0d0bac62016-01-30 02:21:26 -0500138versions, either directly or via the dumb http protocol, then you
Nicolas Pitre9f176882010-02-04 16:19:35 -0500139need to set the configuration variable `repack.UseDeltaBaseOffset` to
140"false" and repack. Access from old Git versions over the native protocol
141is unaffected by this option as the conversion is performed on the fly
142as needed in that case.
Junio C Hamanob6945f52006-10-13 21:28:58 -0700143
Junio C Hamano56ae8df2008-05-28 16:55:27 -0700144SEE ALSO
Junio C Hamanoe31bb3b2005-08-15 15:48:47 -0700145--------
Dan McGee5162e692007-12-29 00:20:38 -0600146linkgit:git-pack-objects[1]
147linkgit:git-prune-packed[1]
Junio C Hamanoe31bb3b2005-08-15 15:48:47 -0700148
149GIT
150---
Christian Couder9e1f0a82008-06-06 09:07:32 +0200151Part of the linkgit:git[1] suite