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 | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 11 | 'git-repack' [-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 | 9cb74f2 | 2007-02-12 04:15:05 | [diff] [blame] | 34 | for private development and there is no need to worry |
Junio C Hamano | 401939f | 2007-07-01 06:34:30 | [diff] [blame] | 35 | about people fetching via dumb protocols from it. Use |
| 36 | with '-d'. This will clean up the objects that `git prune` |
| 37 | leaves behind, but `git fsck --full` shows as |
| 38 | dangling. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 39 | |
| 40 | -d:: |
| 41 | After packing, if the newly created packs make some |
| 42 | existing packs redundant, remove the redundant packs. |
Junio C Hamano | 1bb569e | 2006-05-05 23:14:25 | [diff] [blame] | 43 | Also runs gitlink:git-prune-packed[1]. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 44 | |
| 45 | -l:: |
| 46 | Pass the `--local` option to `git pack-objects`, see |
| 47 | gitlink:git-pack-objects[1]. |
| 48 | |
Junio C Hamano | 7e9f6b7 | 2006-02-22 10:44:55 | [diff] [blame] | 49 | -f:: |
| 50 | Pass the `--no-reuse-delta` option to `git pack-objects`, see |
| 51 | gitlink:git-pack-objects[1]. |
| 52 | |
| 53 | -q:: |
| 54 | Pass the `-q` option to `git pack-objects`, see |
| 55 | gitlink:git-pack-objects[1]. |
| 56 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 57 | -n:: |
| 58 | Do not update the server information with |
| 59 | `git update-server-info`. |
| 60 | |
Junio C Hamano | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 61 | --window=[N], --depth=[N]:: |
Junio C Hamano | 93567a6 | 2006-10-08 08:47:56 | [diff] [blame] | 62 | These two options affect how the objects contained in the pack are |
Junio C Hamano | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 63 | stored using delta compression. The objects are first internally |
| 64 | sorted by type, size and optionally names and compared against the |
| 65 | other objects within `--window` to see if using delta compression saves |
| 66 | space. `--depth` limits the maximum delta depth; making it too deep |
| 67 | affects the performance on the unpacker side, because delta data needs |
| 68 | to be applied that many times to get to the necessary object. |
Junio C Hamano | 91d44c5 | 2007-05-09 07:16:07 | [diff] [blame] | 69 | The default value for --window is 10 and --depth is 50. |
Junio C Hamano | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 70 | |
Junio C Hamano | 235d53f | 2007-07-13 00:25:15 | [diff] [blame] | 71 | --window-memory=[N]:: |
| 72 | This option provides an additional limit on top of `--window`; |
| 73 | the window size will dynamically scale down so as to not take |
| 74 | up more than N bytes in memory. This is useful in |
| 75 | repositories with a mix of large and small objects to not run |
| 76 | out of memory with a large window, but still be able to take |
| 77 | advantage of the large window for the smaller objects. The |
| 78 | size can be suffixed with "k", "m", or "g". |
| 79 | `--window-memory=0` makes memory usage unlimited, which is the |
| 80 | default. |
| 81 | |
Junio C Hamano | 591dc6a | 2007-05-29 09:18:19 | [diff] [blame] | 82 | --max-pack-size=<n>:: |
| 83 | Maximum size of each output packfile, expressed in MiB. |
| 84 | If specified, multiple packfiles may be created. |
| 85 | The default is unlimited. |
| 86 | |
Junio C Hamano | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 87 | |
Junio C Hamano | 77b7e90 | 2006-10-23 07:18:50 | [diff] [blame] | 88 | Configuration |
| 89 | ------------- |
| 90 | |
| 91 | When configuration variable `repack.UseDeltaBaseOffset` is set |
| 92 | for the repository, the command passes `--delta-base-offset` |
| 93 | option to `git-pack-objects`; this typically results in slightly |
| 94 | smaller packs, but the generated packs are incompatible with |
| 95 | versions of git older than (and including) v1.4.3; do not set |
| 96 | the variable in a repository that older version of git needs to |
| 97 | be able to read (this includes repositories from which packs can |
| 98 | be copied out over http or rsync, and people who obtained packs |
| 99 | that way can try to use older git with it). |
| 100 | |
| 101 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 102 | Author |
| 103 | ------ |
| 104 | Written by Linus Torvalds <torvalds@osdl.org> |
| 105 | |
| 106 | Documentation |
| 107 | -------------- |
| 108 | Documentation by Ryan Anderson <ryan@michonline.com> |
| 109 | |
Junio C Hamano | decf50e | 2006-03-05 10:51:14 | [diff] [blame] | 110 | See Also |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 111 | -------- |
| 112 | gitlink:git-pack-objects[1] |
| 113 | gitlink:git-prune-packed[1] |
| 114 | |
| 115 | GIT |
| 116 | --- |
| 117 | Part of the gitlink:git[7] suite |