blob: c9257a10c956432fdd2e456c7f910cc2996c1534 [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 Hamanofce7c7e2008-07-02 03:06:3811'git repack' [-a] [-A] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N]
Junio C Hamano1a4e8412005-12-27 08:17:2312
13DESCRIPTION
14-----------
15
16This script is used to combine all objects that do not currently
Junio C Hamanoa6387422007-08-25 03:54:2717reside in a "pack", into a pack. It can also be used to re-organize
Junio C Hamano401939f2007-07-01 06:34:3018existing packs into a single, more efficient pack.
Junio C Hamano1a4e8412005-12-27 08:17:2319
20A pack is a collection of objects, individually compressed, with
21delta compression applied, stored in a single file, with an
22associated index file.
23
24Packs are used to reduce the load on mirror systems, backup
25engines, disk storage, etc.
26
27OPTIONS
28-------
29
30-a::
31Instead of incrementally packing the unpacked objects,
Junio C Hamano401939f2007-07-01 06:34:3032pack everything referenced into a single pack.
Junio C Hamano1a4e8412005-12-27 08:17:2333Especially useful when packing a repository that is used
Junio C Hamano4d81e522009-06-10 08:08:5134for private development. Use
Junio C Hamano401939f2007-07-01 06:34:3035with '-d'. This will clean up the objects that `git prune`
36leaves behind, but `git fsck --full` shows as
37dangling.
Junio C Hamano4d81e522009-06-10 08:08:5138+
39Note that users fetching over dumb protocols will have to fetch the
40whole new pack in order to get any contained object, no matter how many
41other objects in that pack they already have locally.
Junio C Hamano1a4e8412005-12-27 08:17:2342
Junio C Hamanob713ff12008-05-24 01:12:3043-A::
Junio C Hamanobba37ad2008-11-16 17:47:5944Same as `-a`, unless '-d' is used. Then any unreachable
45objects in a previous pack become loose, unpacked objects,
46instead of being left in the old pack. Unreachable objects
47are never intentionally added to a pack, even when repacking.
48This option prevents unreachable objects from being immediately
Junio C Hamanob713ff12008-05-24 01:12:3049deleted by way of being left in the old pack and then
50removed. Instead, the loose unreachable objects
51will be pruned according to normal expiry rules
Junio C Hamanoba4b9282008-07-06 05:20:3152with the next 'git-gc' invocation. See linkgit:git-gc[1].
Junio C Hamanob713ff12008-05-24 01:12:3053
Junio C Hamano1a4e8412005-12-27 08:17:2354-d::
55After packing, if the newly created packs make some
56existing packs redundant, remove the redundant packs.
Junio C Hamanoba4b9282008-07-06 05:20:3157Also run 'git-prune-packed' to remove redundant
Junio C Hamanofce7c7e2008-07-02 03:06:3858loose object files.
Junio C Hamano1a4e8412005-12-27 08:17:2359
60-l::
Junio C Hamanoba4b9282008-07-06 05:20:3161Pass the `--local` option to 'git-pack-objects'. See
Junio C Hamano35738e82008-01-07 07:55:4662linkgit:git-pack-objects[1].
Junio C Hamano1a4e8412005-12-27 08:17:2363
Junio C Hamano7e9f6b72006-02-22 10:44:5564-f::
Junio C Hamano7cc91292008-09-20 16:55:3865Pass the `--no-reuse-object` option to `git-pack-objects`, see
Junio C Hamano35738e82008-01-07 07:55:4666linkgit:git-pack-objects[1].
Junio C Hamano7e9f6b72006-02-22 10:44:5567
68-q::
Junio C Hamanoba4b9282008-07-06 05:20:3169Pass the `-q` option to 'git-pack-objects'. See
Junio C Hamano35738e82008-01-07 07:55:4670linkgit:git-pack-objects[1].
Junio C Hamano7e9f6b72006-02-22 10:44:5571
Junio C Hamano1a4e8412005-12-27 08:17:2372-n::
Junio C Hamanob713ff12008-05-24 01:12:3073Do not update the server information with
Junio C Hamanoba4b9282008-07-06 05:20:3174'git-update-server-info'. This option skips
Junio C Hamanob713ff12008-05-24 01:12:3075updating local catalog files needed to publish
76this repository (or a direct copy of it)
Junio C Hamanoba4b9282008-07-06 05:20:3177over HTTP or FTP. See linkgit:git-update-server-info[1].
Junio C Hamano1a4e8412005-12-27 08:17:2378
Junio C Hamanoeb415992008-06-08 22:49:4779--window=[N]::
80--depth=[N]::
Junio C Hamano93567a62006-10-08 08:47:5681These two options affect how the objects contained in the pack are
Junio C Hamano3eb513f2006-09-18 02:47:1682stored using delta compression. The objects are first internally
83sorted by type, size and optionally names and compared against the
84other objects within `--window` to see if using delta compression saves
85space. `--depth` limits the maximum delta depth; making it too deep
86affects the performance on the unpacker side, because delta data needs
87to be applied that many times to get to the necessary object.
Junio C Hamano91d44c52007-05-09 07:16:0788The default value for --window is 10 and --depth is 50.
Junio C Hamano3eb513f2006-09-18 02:47:1689
Junio C Hamano235d53f2007-07-13 00:25:1590--window-memory=[N]::
91This option provides an additional limit on top of `--window`;
92the window size will dynamically scale down so as to not take
93up more than N bytes in memory. This is useful in
94repositories with a mix of large and small objects to not run
95out of memory with a large window, but still be able to take
96advantage of the large window for the smaller objects. The
97size can be suffixed with "k", "m", or "g".
98`--window-memory=0` makes memory usage unlimited, which is the
99default.
100
Junio C Hamano591dc6a2007-05-29 09:18:19101--max-pack-size=<n>::
102Maximum size of each output packfile, expressed in MiB.
103If specified, multiple packfiles may be created.
104The default is unlimited.
105
Junio C Hamano3eb513f2006-09-18 02:47:16106
Junio C Hamano77b7e902006-10-23 07:18:50107Configuration
108-------------
109
110When configuration variable `repack.UseDeltaBaseOffset` is set
111for the repository, the command passes `--delta-base-offset`
Junio C Hamanoba4b9282008-07-06 05:20:31112option to 'git-pack-objects'; this typically results in slightly
Junio C Hamano77b7e902006-10-23 07:18:50113smaller packs, but the generated packs are incompatible with
114versions of git older than (and including) v1.4.3; do not set
115the variable in a repository that older version of git needs to
116be able to read (this includes repositories from which packs can
117be copied out over http or rsync, and people who obtained packs
118that way can try to use older git with it).
119
120
Junio C Hamano1a4e8412005-12-27 08:17:23121Author
122------
123Written by Linus Torvalds <torvalds@osdl.org>
124
125Documentation
126--------------
127Documentation by Ryan Anderson <ryan@michonline.com>
128
Junio C Hamano9049d912008-05-29 02:09:50129SEE ALSO
Junio C Hamano1a4e8412005-12-27 08:17:23130--------
Junio C Hamano35738e82008-01-07 07:55:46131linkgit:git-pack-objects[1]
132linkgit:git-prune-packed[1]
Junio C Hamano1a4e8412005-12-27 08:17:23133
134GIT
135---
Junio C Hamanof7c042d2008-06-06 22:50:53136Part of the linkgit:git[1] suite