2 .\" Title: git-index-pack
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
7 .\" Source: Git 2.46.1.506.ged155187b4
10 .TH "GIT\-INDEX\-PACK" "1" "2024-09-13" "Git 2\&.46\&.1\&.506\&.ged1551" "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>]
41 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\&.
46 Be verbose about what is going on, including progress status\&.
51 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)\&.
56 When this flag is provided, generate a reverse index (a
58 file) corresponding to the given pack\&. If
60 is given, ensure that the existing reverse index is correct\&. Takes precedence over
61 \fBpack\&.writeReverseIndex\fR\&.
66 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
72 Fix a "thin" pack produced by
73 \fBgit pack\-objects \-\-thin\fR
75 \fBgit-pack-objects\fR(1)
76 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\&.
81 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
83 process from deleting the newly constructed pack and index before refs can be updated to use objects contained in the pack\&.
88 Like \-\-keep, create a \&.keep file before moving the index into its final destination\&. However, instead of creating an empty file place
90 followed by an LF into the \&.keep file\&. The
92 message can later be searched for within all \&.keep files to locate any which have outlived their usefulness\&.
95 \-\-index\-version=<version>[,<offset>]
97 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\&.
100 \-\-strict[=<msg\-id>=<severity>\&...\:]
102 Die, if the pack contains broken objects or links\&. An optional comma\-separated list of
103 \fB<msg\-id>=<severity>\fR
104 can be passed to change the severity of some possible issues, e\&.g\&.,
105 \fB\-\-strict="missingEmail=ignore,badTagName=error"\fR\&. See the entry for the
106 \fBfsck\&.<msg\-id>\fR
107 configuration options in
109 for more information on the possible values of
117 For internal use only\&.
119 Set the title of the progress bar\&. The title is "Receiving objects" by default and "Indexing objects" when
124 \-\-check\-self\-contained\-and\-connected
126 Die if the pack contains broken links\&. For internal use only\&.
129 \-\-fsck\-objects[=<msg\-id>=<severity>\&...\:]
131 Die if the pack contains broken objects, but unlike
132 \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")\&.
134 An optional comma\-separated list of
135 \fB<msg\-id>=<severity>\fR
136 can be passed to change the severity of some possible issues, e\&.g\&.,
137 \fB\-\-fsck\-objects="missingEmail=ignore,badTagName=ignore"\fR\&. See the entry for the
138 \fBfsck\&.<msg\-id>\fR
139 configuration options in
141 for more information on the possible values of
149 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\&.
152 \-\-max\-input\-size=<size>
154 Die, if the pack is larger than <size>\&.
157 \-\-object\-format=<hash\-algorithm>
159 Specify the given object format (hash algorithm) for the pack\&. The valid values are
162 \fIsha256\fR\&. The default is the algorithm for the current repository (set by
163 \fBextensions\&.objectFormat\fR), or
165 if no value is set or outside a repository\&.
167 This option cannot be used with \-\-stdin\&.
169 Note: At present, there is no interoperability between SHA\-256 repositories and SHA\-1 repositories\&.
172 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\&.
174 \-\-promisor[=<message>]
176 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
178 is provided, then that content will be written to the \&.promisor file for future reference\&. See
179 \m[blue]\fBpartial clone\fR\m[]\&\s-2\u[1]\d\s+2
180 for more information\&.
184 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\&.
187 Part of the \fBgit\fR(1) suite
192 \%git-htmldocs/technical/partial-clone.html