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.41.0.rc0.4.g004e0f790f
10 .TH "GIT\-INDEX\-PACK" "1" "2023\-05\-17" "Git 2\&.41\&.0\&.rc0\&.4\&.g00" "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, and builds a pack index file (\&.idx) for it\&. 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, but rather than 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\&.
103 Die, if the pack contains broken objects or links\&.
108 For internal use only\&.
110 Set the title of the progress bar\&. The title is "Receiving objects" by default and "Indexing objects" when
115 \-\-check\-self\-contained\-and\-connected
117 Die if the pack contains broken links\&. For internal use only\&.
122 For internal use only\&.
124 Die if the pack contains broken objects\&. 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")\&.
129 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\&.
132 \-\-max\-input\-size=<size>
134 Die, if the pack is larger than <size>\&.
137 \-\-object\-format=<hash\-algorithm>
139 Specify the given object format (hash algorithm) for the pack\&. The valid values are
142 \fIsha256\fR\&. The default is the algorithm for the current repository (set by
143 \fBextensions\&.objectFormat\fR), or
145 if no value is set or outside a repository\&.
147 This option cannot be used with \-\-stdin\&.
149 THIS OPTION IS EXPERIMENTAL! SHA\-256 support is experimental and still in an early stage\&. A SHA\-256 repository will in general not be able to share work with "regular" SHA\-1 repositories\&. It should be assumed that, e\&.g\&., Git internal file formats in relation to SHA\-256 repositories may change in backwards\-incompatible ways\&. Only use
150 \fB\-\-object\-format=sha256\fR
151 for testing purposes\&.
154 \-\-promisor[=<message>]
156 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
158 is provided, then that content will be written to the \&.promisor file for future reference\&. See
159 \m[blue]\fBpartial clone\fR\m[]\&\s-2\u[1]\d\s+2
160 for more information\&.
164 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\&.
167 Part of the \fBgit\fR(1) suite
172 \%git-htmldocs/technical/partial-clone.html