Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-repack(1) |
| 2 | ============= |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | 7c73c66 | 2007-01-19 00:37:50 | [diff] [blame] | 6 | git-repack - Pack unpacked objects in a repository |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 11 | 'git repack' [-a] [-A] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 12 | |
| 13 | DESCRIPTION |
| 14 | ----------- |
| 15 | |
| 16 | This script is used to combine all objects that do not currently |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame] | 17 | reside in a "pack", into a pack. It can also be used to re-organize |
Junio C Hamano | 401939f | 2007-07-01 06:34:30 | [diff] [blame] | 18 | existing packs into a single, more efficient pack. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 19 | |
| 20 | A pack is a collection of objects, individually compressed, with |
| 21 | delta compression applied, stored in a single file, with an |
| 22 | associated index file. |
| 23 | |
| 24 | Packs are used to reduce the load on mirror systems, backup |
| 25 | engines, disk storage, etc. |
| 26 | |
| 27 | OPTIONS |
| 28 | ------- |
| 29 | |
| 30 | -a:: |
| 31 | Instead of incrementally packing the unpacked objects, |
Junio C Hamano | 401939f | 2007-07-01 06:34:30 | [diff] [blame] | 32 | pack everything referenced into a single pack. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 33 | Especially useful when packing a repository that is used |
Junio C Hamano | 4d81e52 | 2009-06-10 08:08:51 | [diff] [blame] | 34 | for private development. Use |
Junio C Hamano | 401939f | 2007-07-01 06:34:30 | [diff] [blame] | 35 | with '-d'. This will clean up the objects that `git prune` |
| 36 | leaves behind, but `git fsck --full` shows as |
| 37 | dangling. |
Junio C Hamano | 4d81e52 | 2009-06-10 08:08:51 | [diff] [blame] | 38 | + |
| 39 | Note that users fetching over dumb protocols will have to fetch the |
| 40 | whole new pack in order to get any contained object, no matter how many |
| 41 | other objects in that pack they already have locally. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 42 | |
Junio C Hamano | b713ff1 | 2008-05-24 01:12:30 | [diff] [blame] | 43 | -A:: |
Junio C Hamano | bba37ad | 2008-11-16 17:47:59 | [diff] [blame] | 44 | Same as `-a`, unless '-d' is used. Then any unreachable |
| 45 | objects in a previous pack become loose, unpacked objects, |
| 46 | instead of being left in the old pack. Unreachable objects |
| 47 | are never intentionally added to a pack, even when repacking. |
| 48 | This option prevents unreachable objects from being immediately |
Junio C Hamano | b713ff1 | 2008-05-24 01:12:30 | [diff] [blame] | 49 | deleted by way of being left in the old pack and then |
| 50 | removed. Instead, the loose unreachable objects |
| 51 | will be pruned according to normal expiry rules |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 52 | with the next 'git-gc' invocation. See linkgit:git-gc[1]. |
Junio C Hamano | b713ff1 | 2008-05-24 01:12:30 | [diff] [blame] | 53 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 54 | -d:: |
| 55 | After packing, if the newly created packs make some |
| 56 | existing packs redundant, remove the redundant packs. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 57 | Also run 'git-prune-packed' to remove redundant |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 58 | loose object files. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 59 | |
| 60 | -l:: |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 61 | Pass the `--local` option to 'git-pack-objects'. See |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 62 | linkgit:git-pack-objects[1]. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 63 | |
Junio C Hamano | 7e9f6b7 | 2006-02-22 10:44:55 | [diff] [blame] | 64 | -f:: |
Junio C Hamano | 7cc9129 | 2008-09-20 16:55:38 | [diff] [blame] | 65 | Pass the `--no-reuse-object` option to `git-pack-objects`, see |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 66 | linkgit:git-pack-objects[1]. |
Junio C Hamano | 7e9f6b7 | 2006-02-22 10:44:55 | [diff] [blame] | 67 | |
| 68 | -q:: |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 69 | Pass the `-q` option to 'git-pack-objects'. See |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 70 | linkgit:git-pack-objects[1]. |
Junio C Hamano | 7e9f6b7 | 2006-02-22 10:44:55 | [diff] [blame] | 71 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 72 | -n:: |
Junio C Hamano | b713ff1 | 2008-05-24 01:12:30 | [diff] [blame] | 73 | Do not update the server information with |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 74 | 'git-update-server-info'. This option skips |
Junio C Hamano | b713ff1 | 2008-05-24 01:12:30 | [diff] [blame] | 75 | updating local catalog files needed to publish |
| 76 | this repository (or a direct copy of it) |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 77 | over HTTP or FTP. See linkgit:git-update-server-info[1]. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 78 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 79 | --window=[N]:: |
| 80 | --depth=[N]:: |
Junio C Hamano | 93567a6 | 2006-10-08 08:47:56 | [diff] [blame] | 81 | These two options affect how the objects contained in the pack are |
Junio C Hamano | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 82 | stored using delta compression. The objects are first internally |
| 83 | sorted by type, size and optionally names and compared against the |
| 84 | other objects within `--window` to see if using delta compression saves |
| 85 | space. `--depth` limits the maximum delta depth; making it too deep |
| 86 | affects the performance on the unpacker side, because delta data needs |
| 87 | to be applied that many times to get to the necessary object. |
Junio C Hamano | 91d44c5 | 2007-05-09 07:16:07 | [diff] [blame] | 88 | The default value for --window is 10 and --depth is 50. |
Junio C Hamano | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 89 | |
Junio C Hamano | 235d53f | 2007-07-13 00:25:15 | [diff] [blame] | 90 | --window-memory=[N]:: |
| 91 | This option provides an additional limit on top of `--window`; |
| 92 | the window size will dynamically scale down so as to not take |
| 93 | up more than N bytes in memory. This is useful in |
| 94 | repositories with a mix of large and small objects to not run |
| 95 | out of memory with a large window, but still be able to take |
| 96 | advantage of the large window for the smaller objects. The |
| 97 | size can be suffixed with "k", "m", or "g". |
| 98 | `--window-memory=0` makes memory usage unlimited, which is the |
| 99 | default. |
| 100 | |
Junio C Hamano | 591dc6a | 2007-05-29 09:18:19 | [diff] [blame] | 101 | --max-pack-size=<n>:: |
| 102 | Maximum size of each output packfile, expressed in MiB. |
| 103 | If specified, multiple packfiles may be created. |
| 104 | The default is unlimited. |
| 105 | |
Junio C Hamano | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 106 | |
Junio C Hamano | 77b7e90 | 2006-10-23 07:18:50 | [diff] [blame] | 107 | Configuration |
| 108 | ------------- |
| 109 | |
| 110 | When configuration variable `repack.UseDeltaBaseOffset` is set |
| 111 | for the repository, the command passes `--delta-base-offset` |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 112 | option to 'git-pack-objects'; this typically results in slightly |
Junio C Hamano | 77b7e90 | 2006-10-23 07:18:50 | [diff] [blame] | 113 | smaller packs, but the generated packs are incompatible with |
| 114 | versions of git older than (and including) v1.4.3; do not set |
| 115 | the variable in a repository that older version of git needs to |
| 116 | be able to read (this includes repositories from which packs can |
| 117 | be copied out over http or rsync, and people who obtained packs |
| 118 | that way can try to use older git with it). |
| 119 | |
| 120 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 121 | Author |
| 122 | ------ |
| 123 | Written by Linus Torvalds <torvalds@osdl.org> |
| 124 | |
| 125 | Documentation |
| 126 | -------------- |
| 127 | Documentation by Ryan Anderson <ryan@michonline.com> |
| 128 | |
Junio C Hamano | 9049d91 | 2008-05-29 02:09:50 | [diff] [blame] | 129 | SEE ALSO |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 130 | -------- |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 131 | linkgit:git-pack-objects[1] |
| 132 | linkgit:git-prune-packed[1] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 133 | |
| 134 | GIT |
| 135 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 136 | Part of the linkgit:git[1] suite |