blob: 4c1aff65e62f00db236ccb4f48b6071fc50891f7 [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 Hamanod2179ef2010-10-22 04:12:1712'git repack' [-a] [-A] [-d] [-f] [-F] [-l] [-n] [-q] [--window=<n>] [--depth=<n>]
Junio C Hamano1a4e8412005-12-27 08:17:2313
14DESCRIPTION
15-----------
16
17This script 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 Hamano591dc6a2007-05-29 09:18:19109If specified, multiple packfiles may be created.
Junio C Hamano4d979582010-02-04 06:27:29110The default is unlimited, unless the config variable
111`pack.packSizeLimit` is set.
Junio C Hamano591dc6a2007-05-29 09:18:19112
Junio C Hamano3eb513f2006-09-18 02:47:16113
Junio C Hamano77b7e902006-10-23 07:18:50114Configuration
115-------------
116
Junio C Hamanod3304322010-02-05 03:28:27117By default, the command passes `--delta-base-offset` option to
118'git pack-objects'; this typically results in slightly smaller packs,
119but the generated packs are incompatible with versions of Git older than
120version 1.4.4. If you need to share your repository with such ancient Git
121versions, either directly or via the dumb http or rsync protocol, then you
122need to set the configuration variable `repack.UseDeltaBaseOffset` to
123"false" and repack. Access from old Git versions over the native protocol
124is unaffected by this option as the conversion is performed on the fly
125as needed in that case.
Junio C Hamano77b7e902006-10-23 07:18:50126
Junio C Hamano9049d912008-05-29 02:09:50127SEE ALSO
Junio C Hamano1a4e8412005-12-27 08:17:23128--------
Junio C Hamano35738e82008-01-07 07:55:46129linkgit:git-pack-objects[1]
130linkgit:git-prune-packed[1]
Junio C Hamano1a4e8412005-12-27 08:17:23131
132GIT
133---
Junio C Hamanof7c042d2008-06-06 22:50:53134Part of the linkgit:git[1] suite