2 .\" Title: git-index-pack
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.44.0.53.g0f9d4d28b7
10 .TH "GIT\-INDEX\-PACK" "1" "2024\-02\-27" "Git 2\&.44\&.0\&.53\&.g0f9d4d2" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-index-pack \- Build pack index file for an existing packed archive
35 \fIgit index\-pack\fR [\-v] [\-o <index\-file>] [\-\-[no\-]rev\-index] <pack\-file>
36 \fIgit index\-pack\fR \-\-stdin [\-\-fix\-thin] [\-\-keep] [\-v] [\-o <index\-file>]
37 [\-\-[no\-]rev\-index] [<pack\-file>]
42 Reads a packed archive (\&.pack) from the specified file, builds a pack index file (\&.idx) for it, and optionally writes a reverse\-index (\&.rev) for the specified pack\&. The packed archive, together with the pack index, can then be placed in the objects/pack/ directory of a Git repository\&.
47 Be verbose about what is going on, including progress status\&.
52 Write the generated pack index into the specified file\&. Without this option the name of pack index file is constructed from the name of packed archive file by replacing \&.pack with \&.idx (and the program fails if the name of packed archive does not end with \&.pack)\&.
57 When this flag is provided, generate a reverse index (a
59 file) corresponding to the given pack\&. If
61 is given, ensure that the existing reverse index is correct\&. Takes precedence over
62 \fBpack\&.writeReverseIndex\fR\&.
67 When this flag is provided, the pack is read from stdin instead and a copy is then written to <pack\-file>\&. If <pack\-file> is not specified, the pack is written to objects/pack/ directory of the current Git repository with a default name determined from the pack content\&. If <pack\-file> is not specified consider using \-\-keep to prevent a race condition between this process and
73 Fix a "thin" pack produced by
74 \fBgit pack\-objects \-\-thin\fR
76 \fBgit-pack-objects\fR(1)
77 for details) by adding the excluded objects the deltified objects are based on to the pack\&. This option only makes sense in conjunction with \-\-stdin\&.
82 Before moving the index into its final destination create an empty \&.keep file for the associated pack file\&. This option is usually necessary with \-\-stdin to prevent a simultaneous
84 process from deleting the newly constructed pack and index before refs can be updated to use objects contained in the pack\&.
89 Like \-\-keep, create a \&.keep file before moving the index into its final destination\&. However, instead of creating an empty file place
91 followed by an LF into the \&.keep file\&. The
93 message can later be searched for within all \&.keep files to locate any which have outlived their usefulness\&.
96 \-\-index\-version=<version>[,<offset>]
98 This is intended to be used by the test suite only\&. It allows to force the version for the generated pack index, and to force 64\-bit index entries on objects located above the given offset\&.
101 \-\-strict[=<msg\-id>=<severity>\&...]
103 Die, if the pack contains broken objects or links\&. An optional comma\-separated list of
104 \fB<msg\-id>=<severity>\fR
105 can be passed to change the severity of some possible issues, e\&.g\&.,
106 \fB\-\-strict="missingEmail=ignore,badTagName=error"\fR\&. See the entry for the
107 \fBfsck\&.<msg\-id>\fR
108 configuration options in
110 for more information on the possible values of
118 For internal use only\&.
120 Set the title of the progress bar\&. The title is "Receiving objects" by default and "Indexing objects" when
125 \-\-check\-self\-contained\-and\-connected
127 Die if the pack contains broken links\&. For internal use only\&.
130 \-\-fsck\-objects[=<msg\-id>=<severity>\&...]
132 Die if the pack contains broken objects, but unlike
133 \fB\-\-strict\fR, don\(cqt choke on broken links\&. If the pack contains a tree pointing to a \&.gitmodules blob that does not exist, prints the hash of that blob (for the caller to check) after the hash that goes into the name of the pack/idx file (see "Notes")\&.
135 An optional comma\-separated list of
136 \fB<msg\-id>=<severity>\fR
137 can be passed to change the severity of some possible issues, e\&.g\&.,
138 \fB\-\-fsck\-objects="missingEmail=ignore,badTagName=ignore"\fR\&. See the entry for the
139 \fBfsck\&.<msg\-id>\fR
140 configuration options in
142 for more information on the possible values of
150 Specifies the number of threads to spawn when resolving deltas\&. This requires that index\-pack be compiled with pthreads otherwise this option is ignored with a warning\&. This is meant to reduce packing time on multiprocessor machines\&. The required amount of memory for the delta search window is however multiplied by the number of threads\&. Specifying 0 will cause Git to auto\-detect the number of CPU\(cqs and use maximum 3 threads\&.
153 \-\-max\-input\-size=<size>
155 Die, if the pack is larger than <size>\&.
158 \-\-object\-format=<hash\-algorithm>
160 Specify the given object format (hash algorithm) for the pack\&. The valid values are
163 \fIsha256\fR\&. The default is the algorithm for the current repository (set by
164 \fBextensions\&.objectFormat\fR), or
166 if no value is set or outside a repository\&.
168 This option cannot be used with \-\-stdin\&.
170 Note: At present, there is no interoperability between SHA\-256 repositories and SHA\-1 repositories\&.
173 Historically, we warned that SHA\-256 repositories may later need backward incompatible changes when we introduce such interoperability features\&. Today, we only expect compatible changes\&. Furthermore, if such changes prove to be necessary, it can be expected that SHA\-256 repositories created with today\(cqs Git will be usable by future versions of Git without data loss\&.
175 \-\-promisor[=<message>]
177 Before committing the pack\-index, create a \&.promisor file for this pack\&. Particularly helpful when writing a promisor pack with \-\-fix\-thin since the name of the pack is not final until the pack has been fully written\&. If a
179 is provided, then that content will be written to the \&.promisor file for future reference\&. See
180 \m[blue]\fBpartial clone\fR\m[]\&\s-2\u[1]\d\s+2
181 for more information\&.
185 Once the index has been created, the hash that goes into the name of the pack/idx file is printed to stdout\&. If \-\-stdin was also used then this is prefixed by either "pack\et", or "keep\et" if a new \&.keep file was successfully created\&. This is useful to remove a \&.keep file used as a lock to prevent the race with \fIgit repack\fR mentioned above\&.
188 Part of the \fBgit\fR(1) suite
193 \%git-htmldocs/technical/partial-clone.html