Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-index-pack(1) |
| 2 | ================= |
| 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | git-index-pack - Build pack index file for an existing packed archive |
| 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | a9b8d24 | 2007-05-19 04:51:55 | [diff] [blame] | 11 | [verse] |
Junio C Hamano | b4fc8e8 | 2021-02-12 22:46:42 | [diff] [blame] | 12 | 'git index-pack' [-v] [-o <index-file>] [--[no-]rev-index] <pack-file> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 13 | 'git index-pack' --stdin [--fix-thin] [--keep] [-v] [-o <index-file>] |
Junio C Hamano | b4fc8e8 | 2021-02-12 22:46:42 | [diff] [blame] | 14 | [--[no-]rev-index] [<pack-file>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 15 | |
| 16 | |
| 17 | DESCRIPTION |
| 18 | ----------- |
Junio C Hamano | 33be821 | 2023-10-23 21:45:54 | [diff] [blame] | 19 | Reads a packed archive (.pack) from the specified file, |
| 20 | builds a pack index file (.idx) for it, and optionally writes a |
Junio C Hamano | b4fc8e8 | 2021-02-12 22:46:42 | [diff] [blame] | 21 | reverse-index (.rev) for the specified pack. The packed |
Junio C Hamano | 33be821 | 2023-10-23 21:45:54 | [diff] [blame] | 22 | archive, together with the pack index, can then be placed in |
Junio C Hamano | b4fc8e8 | 2021-02-12 22:46:42 | [diff] [blame] | 23 | the objects/pack/ directory of a Git repository. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 24 | |
| 25 | |
| 26 | OPTIONS |
| 27 | ------- |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 28 | -v:: |
| 29 | Be verbose about what is going on, including progress status. |
| 30 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 31 | -o <index-file>:: |
| 32 | Write the generated pack index into the specified |
| 33 | file. Without this option the name of pack index |
| 34 | file is constructed from the name of packed archive |
| 35 | file by replacing .pack with .idx (and the program |
| 36 | fails if the name of packed archive does not end |
| 37 | with .pack). |
| 38 | |
Junio C Hamano | b4fc8e8 | 2021-02-12 22:46:42 | [diff] [blame] | 39 | --[no-]rev-index:: |
| 40 | When this flag is provided, generate a reverse index |
| 41 | (a `.rev` file) corresponding to the given pack. If |
| 42 | `--verify` is given, ensure that the existing |
| 43 | reverse index is correct. Takes precedence over |
| 44 | `pack.writeReverseIndex`. |
| 45 | |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 46 | --stdin:: |
| 47 | When this flag is provided, the pack is read from stdin |
| 48 | instead and a copy is then written to <pack-file>. If |
| 49 | <pack-file> is not specified, the pack is written to |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 50 | objects/pack/ directory of the current Git repository with |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 51 | a default name determined from the pack content. If |
| 52 | <pack-file> is not specified consider using --keep to |
| 53 | prevent a race condition between this process and |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 54 | 'git repack'. |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 55 | |
| 56 | --fix-thin:: |
Junio C Hamano | 4fdccb2 | 2010-02-19 09:58:14 | [diff] [blame] | 57 | Fix a "thin" pack produced by `git pack-objects --thin` (see |
| 58 | linkgit:git-pack-objects[1] for details) by adding the |
| 59 | excluded objects the deltified objects are based on to the |
| 60 | pack. This option only makes sense in conjunction with --stdin. |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 61 | |
| 62 | --keep:: |
| 63 | Before moving the index into its final destination |
| 64 | create an empty .keep file for the associated pack file. |
| 65 | This option is usually necessary with --stdin to prevent a |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 66 | simultaneous 'git repack' process from deleting |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 67 | the newly constructed pack and index before refs can be |
| 68 | updated to use objects contained in the pack. |
| 69 | |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 70 | --keep=<msg>:: |
Junio C Hamano | 33be821 | 2023-10-23 21:45:54 | [diff] [blame] | 71 | Like --keep, create a .keep file before moving the index into |
| 72 | its final destination. However, instead of creating an empty file |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 73 | place '<msg>' followed by an LF into the .keep file. The '<msg>' |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 74 | message can later be searched for within all .keep files to |
| 75 | locate any which have outlived their usefulness. |
| 76 | |
Junio C Hamano | e90436a | 2007-04-22 07:22:13 | [diff] [blame] | 77 | --index-version=<version>[,<offset>]:: |
| 78 | This is intended to be used by the test suite only. It allows |
| 79 | to force the version for the generated pack index, and to force |
| 80 | 64-bit index entries on objects located above the given offset. |
| 81 | |
Junio C Hamano | 6546a50 | 2024-02-08 23:48:36 | [diff] [blame] | 82 | --strict[=<msg-id>=<severity>...]:: |
| 83 | Die, if the pack contains broken objects or links. An optional |
| 84 | comma-separated list of `<msg-id>=<severity>` can be passed to change |
| 85 | the severity of some possible issues, e.g., |
| 86 | `--strict="missingEmail=ignore,badTagName=error"`. See the entry for the |
| 87 | `fsck.<msg-id>` configuration options in linkgit:git-fsck[1] for more |
| 88 | information on the possible values of `<msg-id>` and `<severity>`. |
Junio C Hamano | 4f1d8c4 | 2008-03-03 02:01:16 | [diff] [blame] | 89 | |
Junio C Hamano | de44de3 | 2021-09-20 22:46:08 | [diff] [blame] | 90 | --progress-title:: |
| 91 | For internal use only. |
| 92 | + |
| 93 | Set the title of the progress bar. The title is "Receiving objects" by |
| 94 | default and "Indexing objects" when `--stdin` is specified. |
| 95 | |
Junio C Hamano | b7277bf | 2013-06-06 22:34:50 | [diff] [blame] | 96 | --check-self-contained-and-connected:: |
| 97 | Die if the pack contains broken links. For internal use only. |
| 98 | |
Junio C Hamano | 6546a50 | 2024-02-08 23:48:36 | [diff] [blame] | 99 | --fsck-objects[=<msg-id>=<severity>...]:: |
| 100 | Die if the pack contains broken objects, but unlike `--strict`, don't |
| 101 | choke on broken links. If the pack contains a tree pointing to a |
| 102 | .gitmodules blob that does not exist, prints the hash of that blob |
| 103 | (for the caller to check) after the hash that goes into the name of the |
| 104 | pack/idx file (see "Notes"). |
Junio C Hamano | b66f8a5 | 2021-03-03 07:07:49 | [diff] [blame] | 105 | + |
Junio C Hamano | 6546a50 | 2024-02-08 23:48:36 | [diff] [blame] | 106 | An optional comma-separated list of `<msg-id>=<severity>` can be passed to |
| 107 | change the severity of some possible issues, e.g., |
| 108 | `--fsck-objects="missingEmail=ignore,badTagName=ignore"`. See the entry for the |
| 109 | `fsck.<msg-id>` configuration options in linkgit:git-fsck[1] for more |
| 110 | information on the possible values of `<msg-id>` and `<severity>`. |
Junio C Hamano | 8100016 | 2018-03-21 19:54:50 | [diff] [blame] | 111 | |
Junio C Hamano | f94fd6c | 2012-05-17 22:55:14 | [diff] [blame] | 112 | --threads=<n>:: |
| 113 | Specifies the number of threads to spawn when resolving |
| 114 | deltas. This requires that index-pack be compiled with |
| 115 | pthreads otherwise this option is ignored with a warning. |
| 116 | This is meant to reduce packing time on multiprocessor |
| 117 | machines. The required amount of memory for the delta search |
| 118 | window is however multiplied by the number of threads. |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 119 | Specifying 0 will cause Git to auto-detect the number of CPU's |
Junio C Hamano | f94fd6c | 2012-05-17 22:55:14 | [diff] [blame] | 120 | and use maximum 3 threads. |
| 121 | |
Junio C Hamano | cd45166 | 2016-09-13 00:54:09 | [diff] [blame] | 122 | --max-input-size=<size>:: |
| 123 | Die, if the pack is larger than <size>. |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 124 | |
Junio C Hamano | a891178 | 2020-07-07 05:35:57 | [diff] [blame] | 125 | --object-format=<hash-algorithm>:: |
| 126 | Specify the given object format (hash algorithm) for the pack. The valid |
| 127 | values are 'sha1' and (if enabled) 'sha256'. The default is the algorithm for |
| 128 | the current repository (set by `extensions.objectFormat`), or 'sha1' if no |
| 129 | value is set or outside a repository. |
| 130 | + |
| 131 | This option cannot be used with --stdin. |
Junio C Hamano | 48d7a8a | 2020-08-24 22:56:56 | [diff] [blame] | 132 | + |
| 133 | include::object-format-disclaimer.txt[] |
Junio C Hamano | a891178 | 2020-07-07 05:35:57 | [diff] [blame] | 134 | |
Junio C Hamano | 67fef49 | 2022-03-27 17:31:23 | [diff] [blame] | 135 | --promisor[=<message>]:: |
| 136 | Before committing the pack-index, create a .promisor file for this |
| 137 | pack. Particularly helpful when writing a promisor pack with --fix-thin |
| 138 | since the name of the pack is not final until the pack has been fully |
| 139 | written. If a `<message>` is provided, then that content will be |
| 140 | written to the .promisor file for future reference. See |
| 141 | link:technical/partial-clone.html[partial clone] for more information. |
| 142 | |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 143 | NOTES |
| 144 | ----- |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 145 | |
Junio C Hamano | 9c649b4 | 2020-07-31 05:19:26 | [diff] [blame] | 146 | Once the index has been created, the hash that goes into the name of |
| 147 | the pack/idx file is printed to stdout. If --stdin was |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 148 | also used then this is prefixed by either "pack\t", or "keep\t" if a |
| 149 | new .keep file was successfully created. This is useful to remove a |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 150 | .keep file used as a lock to prevent the race with 'git repack' |
Junio C Hamano | 0d3c815 | 2006-11-08 01:33:41 | [diff] [blame] | 151 | mentioned above. |
| 152 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 153 | GIT |
| 154 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 155 | Part of the linkgit:git[1] suite |