blob: b58b6b597245947898712b6f671ec316c2080275 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-repack(1)
2=============
3
4NAME
5----
Junio C Hamano7c73c662007-01-19 00:37:506git-repack - Pack unpacked objects in a repository
Junio C Hamano1a4e8412005-12-27 08:17:237
8
9SYNOPSIS
10--------
Junio C Hamano15567bc2011-07-23 00:51:5911[verse]
Junio C Hamano5b3533d2014-02-27 23:07:1512'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [-b] [--window=<n>] [--depth=<n>]
Junio C Hamano1a4e8412005-12-27 08:17:2313
14DESCRIPTION
15-----------
16
Junio C Hamano79a784d2013-10-28 19:15:4317This command is used to combine all objects that do not currently
Junio C Hamanoa6387422007-08-25 03:54:2718reside in a "pack", into a pack. It can also be used to re-organize
Junio C Hamano401939f2007-07-01 06:34:3019existing packs into a single, more efficient pack.
Junio C Hamano1a4e8412005-12-27 08:17:2320
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::
32Instead of incrementally packing the unpacked objects,
Junio C Hamano401939f2007-07-01 06:34:3033pack everything referenced into a single pack.
Junio C Hamano1a4e8412005-12-27 08:17:2334Especially useful when packing a repository that is used
Junio C Hamano4d81e522009-06-10 08:08:5135for private development. Use
Junio C Hamano401939f2007-07-01 06:34:3036with '-d'. This will clean up the objects that `git prune`
Junio C Hamano81d540a2012-03-02 19:52:4737leaves behind, but `git fsck --full --dangling` shows as
Junio C Hamano401939f2007-07-01 06:34:3038dangling.
Junio C Hamano4d81e522009-06-10 08:08:5139+
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 Hamano1a4e8412005-12-27 08:17:2343
Junio C Hamanob713ff12008-05-24 01:12:3044-A::
Junio C Hamanobba37ad2008-11-16 17:47:5945Same as `-a`, unless '-d' is used. Then any unreachable
46objects in a previous pack become loose, unpacked objects,
47instead of being left in the old pack. Unreachable objects
48are never intentionally added to a pack, even when repacking.
49This option prevents unreachable objects from being immediately
Junio C Hamanob713ff12008-05-24 01:12:3050deleted by way of being left in the old pack and then
51removed. Instead, the loose unreachable objects
52will be pruned according to normal expiry rules
Junio C Hamano1aa40d22010-01-21 17:46:4353with the next 'git gc' invocation. See linkgit:git-gc[1].
Junio C Hamanob713ff12008-05-24 01:12:3054
Junio C Hamano1a4e8412005-12-27 08:17:2355-d::
56After packing, if the newly created packs make some
57existing packs redundant, remove the redundant packs.
Junio C Hamano1aa40d22010-01-21 17:46:4358Also run 'git prune-packed' to remove redundant
Junio C Hamanofce7c7e2008-07-02 03:06:3859loose object files.
Junio C Hamano1a4e8412005-12-27 08:17:2360
61-l::
Junio C Hamano1aa40d22010-01-21 17:46:4362Pass the `--local` option to 'git pack-objects'. See
Junio C Hamano35738e82008-01-07 07:55:4663linkgit:git-pack-objects[1].
Junio C Hamano1a4e8412005-12-27 08:17:2364
Junio C Hamano7e9f6b72006-02-22 10:44:5565-f::
Junio C Hamano657fd8a2010-10-07 00:01:2466Pass the `--no-reuse-delta` option to `git-pack-objects`, see
67linkgit:git-pack-objects[1].
68
69-F::
Junio C Hamano7cc91292008-09-20 16:55:3870Pass the `--no-reuse-object` option to `git-pack-objects`, see
Junio C Hamano35738e82008-01-07 07:55:4671linkgit:git-pack-objects[1].
Junio C Hamano7e9f6b72006-02-22 10:44:5572
73-q::
Junio C Hamano1aa40d22010-01-21 17:46:4374Pass the `-q` option to 'git pack-objects'. See
Junio C Hamano35738e82008-01-07 07:55:4675linkgit:git-pack-objects[1].
Junio C Hamano7e9f6b72006-02-22 10:44:5576
Junio C Hamano1a4e8412005-12-27 08:17:2377-n::
Junio C Hamanob713ff12008-05-24 01:12:3078Do not update the server information with
Junio C Hamano1aa40d22010-01-21 17:46:4379'git update-server-info'. This option skips
Junio C Hamanob713ff12008-05-24 01:12:3080updating local catalog files needed to publish
81this repository (or a direct copy of it)
Junio C Hamanoba4b9282008-07-06 05:20:3182over HTTP or FTP. See linkgit:git-update-server-info[1].
Junio C Hamano1a4e8412005-12-27 08:17:2383
Junio C Hamanod2179ef2010-10-22 04:12:1784--window=<n>::
85--depth=<n>::
Junio C Hamano93567a62006-10-08 08:47:5686These two options affect how the objects contained in the pack are
Junio C Hamano3eb513f2006-09-18 02:47:1687stored using delta compression. The objects are first internally
88sorted by type, size and optionally names and compared against the
89other objects within `--window` to see if using delta compression saves
90space. `--depth` limits the maximum delta depth; making it too deep
91affects the performance on the unpacker side, because delta data needs
92to be applied that many times to get to the necessary object.
Junio C Hamano91d44c52007-05-09 07:16:0793The default value for --window is 10 and --depth is 50.
Junio C Hamano3eb513f2006-09-18 02:47:1694
Junio C Hamanod2179ef2010-10-22 04:12:1795--window-memory=<n>::
Junio C Hamano235d53f2007-07-13 00:25:1596This option provides an additional limit on top of `--window`;
97the window size will dynamically scale down so as to not take
Junio C Hamanod2179ef2010-10-22 04:12:1798up more than '<n>' bytes in memory. This is useful in
Junio C Hamano235d53f2007-07-13 00:25:1599repositories with a mix of large and small objects to not run
100out of memory with a large window, but still be able to take
101advantage of the large window for the smaller objects. The
102size can be suffixed with "k", "m", or "g".
103`--window-memory=0` makes memory usage unlimited, which is the
104default.
105
Junio C Hamanod2179ef2010-10-22 04:12:17106--max-pack-size=<n>::
Junio C Hamano4d979582010-02-04 06:27:29107Maximum 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.
Junio C Hamano74fd0fc2016-05-10 21:23:56109If specified, multiple packfiles may be created, which also
110prevents the creation of a bitmap index.
Junio C Hamano4d979582010-02-04 06:27:29111The default is unlimited, unless the config variable
112`pack.packSizeLimit` is set.
Junio C Hamano591dc6a2007-05-29 09:18:19113
Junio C Hamano5b3533d2014-02-27 23:07:15114-b::
115--write-bitmap-index::
116Write a reachability bitmap index as part of the repack. This
117only makes sense when used with `-a` or `-A`, as the bitmaps
118must be able to refer to all reachable objects. This option
Junio C Hamano74fd0fc2016-05-10 21:23:56119overrides the setting of `repack.writeBitmaps`. This option
120has no effect if multiple packfiles are created.
Junio C Hamano5b3533d2014-02-27 23:07:15121
Junio C Hamano3b0cdc22014-03-18 22:06:16122--pack-kept-objects::
123Include objects in `.keep` files when repacking. Note that we
124still do not delete `.keep` packs after `pack-objects` finishes.
125This means that we may duplicate objects, but this makes the
126option safe to use when there are concurrent pushes or fetches.
127This option is generally only useful if you are writing bitmaps
Junio C Hamano74fd0fc2016-05-10 21:23:56128with `-b` or `repack.writeBitmaps`, as it ensures that the
Junio C Hamano3b0cdc22014-03-18 22:06:16129bitmapped packfile has the necessary objects.
Junio C Hamano3eb513f2006-09-18 02:47:16130
Junio C Hamanoc6c919b2016-07-06 21:34:15131--unpack-unreachable=<when>::
132When loosening unreachable objects, do not bother loosening any
133objects older than `<when>`. This can be used to optimize out
134the write of any objects that would be immediately pruned by
135a follow-up `git prune`.
136
137-k::
138--keep-unreachable::
139When used with `-ad`, any unreachable objects from existing
140packs will be appended to the end of the packfile instead of
141being removed. In addition, any unreachable loose objects will
142be packed (and their loose counterparts removed).
143
Junio C Hamano77b7e902006-10-23 07:18:50144Configuration
145-------------
146
Junio C Hamanod3304322010-02-05 03:28:27147By default, the command passes `--delta-base-offset` option to
148'git pack-objects'; this typically results in slightly smaller packs,
149but the generated packs are incompatible with versions of Git older than
150version 1.4.4. If you need to share your repository with such ancient Git
Junio C Hamanof85ef632016-02-17 22:31:06151versions, either directly or via the dumb http protocol, then you
Junio C Hamanod3304322010-02-05 03:28:27152need to set the configuration variable `repack.UseDeltaBaseOffset` to
153"false" and repack. Access from old Git versions over the native protocol
154is unaffected by this option as the conversion is performed on the fly
155as needed in that case.
Junio C Hamano77b7e902006-10-23 07:18:50156
Junio C Hamano9049d912008-05-29 02:09:50157SEE ALSO
Junio C Hamano1a4e8412005-12-27 08:17:23158--------
Junio C Hamano35738e82008-01-07 07:55:46159linkgit:git-pack-objects[1]
160linkgit:git-prune-packed[1]
Junio C Hamano1a4e8412005-12-27 08:17:23161
162GIT
163---
Junio C Hamanof7c042d2008-06-06 22:50:53164Part of the linkgit:git[1] suite