Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-pack-objects(1) |
| 2 | =================== |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | 0107892 | 2006-03-10 00:31:47 | [diff] [blame] | 6 | git-pack-objects - Create a packed archive of objects |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | 7e9f6b7 | 2006-02-22 10:44:55 | [diff] [blame] | 11 | [verse] |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 12 | 'git pack-objects' [-q] [--no-reuse-delta] [--delta-base-offset] [--non-empty] |
Junio C Hamano | 125a17b | 2006-11-05 08:59:35 | [diff] [blame] | 13 | [--local] [--incremental] [--window=N] [--depth=N] [--all-progress] |
Junio C Hamano | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 14 | [--revs [--unpacked | --all]*] [--stdout | base-name] < object-list |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 15 | |
| 16 | |
| 17 | DESCRIPTION |
| 18 | ----------- |
| 19 | Reads list of objects from the standard input, and writes a packed |
| 20 | archive with specified base-name, or to the standard output. |
| 21 | |
| 22 | A packed archive is an efficient way to transfer set of objects |
| 23 | between two repositories, and also is an archival format which |
| 24 | is efficient to access. The packed archive format (.pack) is |
Junio C Hamano | b553b79 | 2008-04-06 02:02:37 | [diff] [blame] | 25 | designed to be self contained so that it can be unpacked without |
| 26 | any further information, but for fast, random access to the objects |
| 27 | in the pack, a pack index file (.idx) will be generated. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 28 | |
Junio C Hamano | 9810d63 | 2007-09-24 01:05:34 | [diff] [blame] | 29 | Placing both in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or |
| 30 | any of the directories on $GIT_ALTERNATE_OBJECT_DIRECTORIES) |
| 31 | enables git to read from such an archive. |
| 32 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 33 | The 'git-unpack-objects' command can read the packed archive and |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 34 | expand the objects contained in the pack into "one-file |
| 35 | one-object" format; this is typically done by the smart-pull |
| 36 | commands when a pack is created on-the-fly for efficient network |
| 37 | transport by their peers. |
| 38 | |
Junio C Hamano | 7e9f6b7 | 2006-02-22 10:44:55 | [diff] [blame] | 39 | In a packed archive, an object is either stored as a compressed |
| 40 | whole, or as a difference from some other object. The latter is |
| 41 | often called a delta. |
| 42 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 43 | |
| 44 | OPTIONS |
| 45 | ------- |
| 46 | base-name:: |
| 47 | Write into a pair of files (.pack and .idx), using |
| 48 | <base-name> to determine the name of the created file. |
| 49 | When this option is used, the two files are written in |
| 50 | <base-name>-<SHA1>.{pack,idx} files. <SHA1> is a hash |
Junio C Hamano | a2ec14f | 2006-11-02 00:22:48 | [diff] [blame] | 51 | of the sorted object names to make the resulting filename |
| 52 | based on the pack content, and written to the standard |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 53 | output of the command. |
| 54 | |
| 55 | --stdout:: |
Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 56 | Write the pack contents (what would have been written to |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 57 | .pack file) out to the standard output. |
| 58 | |
Junio C Hamano | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 59 | --revs:: |
| 60 | Read the revision arguments from the standard input, instead of |
| 61 | individual object names. The revision arguments are processed |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 62 | the same way as 'git-rev-list' with the `--objects` flag |
Junio C Hamano | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 63 | uses its `commit` arguments to build the list of objects it |
| 64 | outputs. The objects on the resulting list are packed. |
| 65 | |
| 66 | --unpacked:: |
| 67 | This implies `--revs`. When processing the list of |
| 68 | revision arguments read from the standard input, limit |
| 69 | the objects packed to those that are not already packed. |
| 70 | |
| 71 | --all:: |
| 72 | This implies `--revs`. In addition to the list of |
| 73 | revision arguments read from the standard input, pretend |
Junio C Hamano | 93567a6 | 2006-10-08 08:47:56 | [diff] [blame] | 74 | as if all refs under `$GIT_DIR/refs` are specified to be |
Junio C Hamano | 3eb513f | 2006-09-18 02:47:16 | [diff] [blame] | 75 | included. |
| 76 | |
Junio C Hamano | bb34317 | 2008-03-09 10:39:09 | [diff] [blame] | 77 | --include-tag:: |
| 78 | Include unasked-for annotated tags if the object they |
| 79 | reference was included in the resulting packfile. This |
| 80 | can be useful to send new tags to native git clients. |
| 81 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 82 | --window=[N]:: |
| 83 | --depth=[N]:: |
Junio C Hamano | 93567a6 | 2006-10-08 08:47:56 | [diff] [blame] | 84 | These two options affect how the objects contained in |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 85 | the pack are stored using delta compression. The |
| 86 | objects are first internally sorted by type, size and |
| 87 | optionally names and compared against the other objects |
| 88 | within --window to see if using delta compression saves |
| 89 | space. --depth limits the maximum delta depth; making |
| 90 | it too deep affects the performance on the unpacker |
| 91 | side, because delta data needs to be applied that many |
| 92 | times to get to the necessary object. |
Junio C Hamano | 91d44c5 | 2007-05-09 07:16:07 | [diff] [blame] | 93 | The default value for --window is 10 and --depth is 50. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 94 | |
Junio C Hamano | 235d53f | 2007-07-13 00:25:15 | [diff] [blame] | 95 | --window-memory=[N]:: |
| 96 | This option provides an additional limit on top of `--window`; |
| 97 | the window size will dynamically scale down so as to not take |
| 98 | up more than N bytes in memory. This is useful in |
| 99 | repositories with a mix of large and small objects to not run |
| 100 | out of memory with a large window, but still be able to take |
| 101 | advantage of the large window for the smaller objects. The |
| 102 | size can be suffixed with "k", "m", or "g". |
| 103 | `--window-memory=0` makes memory usage unlimited, which is the |
| 104 | default. |
| 105 | |
Junio C Hamano | 591dc6a | 2007-05-29 09:18:19 | [diff] [blame] | 106 | --max-pack-size=<n>:: |
| 107 | Maximum size of each output packfile, expressed in MiB. |
| 108 | If specified, multiple packfiles may be created. |
Junio C Hamano | 49dccaf | 2008-02-10 10:48:01 | [diff] [blame] | 109 | The default is unlimited, unless the config variable |
| 110 | `pack.packSizeLimit` is set. |
Junio C Hamano | 591dc6a | 2007-05-29 09:18:19 | [diff] [blame] | 111 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 112 | --incremental:: |
| 113 | This flag causes an object already in a pack ignored |
| 114 | even if it appears in the standard input. |
| 115 | |
| 116 | --local:: |
| 117 | This flag is similar to `--incremental`; instead of |
| 118 | ignoring all packed objects, it only ignores objects |
| 119 | that are packed and not in the local object store |
| 120 | (i.e. borrowed from an alternate). |
| 121 | |
| 122 | --non-empty:: |
| 123 | Only create a packed archive if it would contain at |
| 124 | least one object. |
| 125 | |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 126 | --progress:: |
| 127 | Progress status is reported on the standard error stream |
| 128 | by default when it is attached to a terminal, unless -q |
| 129 | is specified. This flag forces progress status even if |
| 130 | the standard error stream is not directed to a terminal. |
| 131 | |
| 132 | --all-progress:: |
| 133 | When --stdout is specified then progress report is |
| 134 | displayed during the object count and deltification phases |
| 135 | but inhibited during the write-out phase. The reason is |
| 136 | that in some cases the output stream is directly linked |
| 137 | to another command which may wish to display progress |
| 138 | status of its own as it processes incoming pack data. |
| 139 | This flag is like --progress except that it forces progress |
| 140 | report for the write-out phase as well even if --stdout is |
| 141 | used. |
| 142 | |
Junio C Hamano | 7e9f6b7 | 2006-02-22 10:44:55 | [diff] [blame] | 143 | -q:: |
| 144 | This flag makes the command not to report its progress |
| 145 | on the standard error stream. |
| 146 | |
| 147 | --no-reuse-delta:: |
| 148 | When creating a packed archive in a repository that |
| 149 | has existing packs, the command reuses existing deltas. |
| 150 | This sometimes results in a slightly suboptimal pack. |
| 151 | This flag tells the command not to reuse existing deltas |
| 152 | but compute them from scratch. |
| 153 | |
Junio C Hamano | f2ce297 | 2007-05-20 19:12:09 | [diff] [blame] | 154 | --no-reuse-object:: |
| 155 | This flag tells the command not to reuse existing object data at all, |
| 156 | including non deltified object, forcing recompression of everything. |
| 157 | This implies --no-reuse-delta. Useful only in the obscure case where |
| 158 | wholesale enforcement of a different compression level on the |
| 159 | packed data is desired. |
| 160 | |
| 161 | --compression=[N]:: |
| 162 | Specifies compression level for newly-compressed data in the |
| 163 | generated pack. If not specified, pack compression level is |
| 164 | determined first by pack.compression, then by core.compression, |
| 165 | and defaults to -1, the zlib default, if neither is set. |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 166 | Add --no-reuse-object if you want to force a uniform compression |
Junio C Hamano | ef4c2d1 | 2007-09-10 08:11:27 | [diff] [blame] | 167 | level on all data no matter the source. |
Junio C Hamano | f2ce297 | 2007-05-20 19:12:09 | [diff] [blame] | 168 | |
Junio C Hamano | 77b7e90 | 2006-10-23 07:18:50 | [diff] [blame] | 169 | --delta-base-offset:: |
| 170 | A packed archive can express base object of a delta as |
| 171 | either 20-byte object name or as an offset in the |
| 172 | stream, but older version of git does not understand the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 173 | latter. By default, 'git-pack-objects' only uses the |
Junio C Hamano | 77b7e90 | 2006-10-23 07:18:50 | [diff] [blame] | 174 | former format for better compatibility. This option |
| 175 | allows the command to use the latter format for |
| 176 | compactness. Depending on the average delta chain |
| 177 | length, this option typically shrinks the resulting |
| 178 | packfile by 3-5 per-cent. |
| 179 | |
Junio C Hamano | 58155b4 | 2007-09-15 07:46:14 | [diff] [blame] | 180 | --threads=<n>:: |
| 181 | Specifies the number of threads to spawn when searching for best |
| 182 | delta matches. This requires that pack-objects be compiled with |
| 183 | pthreads otherwise this option is ignored with a warning. |
| 184 | This is meant to reduce packing time on multiprocessor machines. |
| 185 | The required amount of memory for the delta search window is |
| 186 | however multiplied by the number of threads. |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 187 | Specifying 0 will cause git to auto-detect the number of CPU's |
| 188 | and set the number of threads accordingly. |
Junio C Hamano | 58155b4 | 2007-09-15 07:46:14 | [diff] [blame] | 189 | |
Junio C Hamano | e90436a | 2007-04-22 07:22:13 | [diff] [blame] | 190 | --index-version=<version>[,<offset>]:: |
| 191 | This is intended to be used by the test suite only. It allows |
| 192 | to force the version for the generated pack index, and to force |
| 193 | 64-bit index entries on objects located above the given offset. |
| 194 | |
Junio C Hamano | 7e9f6b7 | 2006-02-22 10:44:55 | [diff] [blame] | 195 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 196 | Author |
| 197 | ------ |
| 198 | Written by Linus Torvalds <torvalds@osdl.org> |
| 199 | |
| 200 | Documentation |
| 201 | ------------- |
| 202 | Documentation by Junio C Hamano |
| 203 | |
Junio C Hamano | 9049d91 | 2008-05-29 02:09:50 | [diff] [blame] | 204 | SEE ALSO |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 205 | -------- |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 206 | linkgit:git-rev-list[1] |
| 207 | linkgit:git-repack[1] |
| 208 | linkgit:git-prune-packed[1] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 209 | |
| 210 | GIT |
| 211 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 212 | Part of the linkgit:git[1] suite |