1GIT-INDEX-PACK(1)                 Git Manual                 GIT-INDEX-PACK(1)
2
3
4

NAME

6       git-index-pack - Build pack index file for an existing packed archive
7

SYNOPSIS

9       git index-pack [-v] [-o <index-file>] [--[no-]rev-index] <pack-file>
10       git index-pack --stdin [--fix-thin] [--keep] [-v] [-o <index-file>]
11                         [--[no-]rev-index] [<pack-file>]
12

DESCRIPTION

14       Reads a packed archive (.pack) from the specified file, and builds a
15       pack index file (.idx) for it. Optionally writes a reverse-index (.rev)
16       for the specified pack. The packed archive together with the pack index
17       can then be placed in the objects/pack/ directory of a Git repository.
18

OPTIONS

20       -v
21           Be verbose about what is going on, including progress status.
22
23       -o <index-file>
24           Write the generated pack index into the specified file. Without
25           this option the name of pack index file is constructed from the
26           name of packed archive file by replacing .pack with .idx (and the
27           program fails if the name of packed archive does not end with
28           .pack).
29
30       --[no-]rev-index
31           When this flag is provided, generate a reverse index (a .rev file)
32           corresponding to the given pack. If --verify is given, ensure that
33           the existing reverse index is correct. Takes precedence over
34           pack.writeReverseIndex.
35
36       --stdin
37           When this flag is provided, the pack is read from stdin instead and
38           a copy is then written to <pack-file>. If <pack-file> is not
39           specified, the pack is written to objects/pack/ directory of the
40           current Git repository with a default name determined from the pack
41           content. If <pack-file> is not specified consider using --keep to
42           prevent a race condition between this process and git repack.
43
44       --fix-thin
45           Fix a "thin" pack produced by git pack-objects --thin (see git-
46           pack-objects(1) for details) by adding the excluded objects the
47           deltified objects are based on to the pack. This option only makes
48           sense in conjunction with --stdin.
49
50       --keep
51           Before moving the index into its final destination create an empty
52           .keep file for the associated pack file. This option is usually
53           necessary with --stdin to prevent a simultaneous git repack process
54           from deleting the newly constructed pack and index before refs can
55           be updated to use objects contained in the pack.
56
57       --keep=<msg>
58           Like --keep create a .keep file before moving the index into its
59           final destination, but rather than creating an empty file place
60           <msg> followed by an LF into the .keep file. The <msg> message can
61           later be searched for within all .keep files to locate any which
62           have outlived their usefulness.
63
64       --index-version=<version>[,<offset>]
65           This is intended to be used by the test suite only. It allows to
66           force the version for the generated pack index, and to force 64-bit
67           index entries on objects located above the given offset.
68
69       --strict
70           Die, if the pack contains broken objects or links.
71
72       --progress-title
73           For internal use only.
74
75           Set the title of the progress bar. The title is "Receiving objects"
76           by default and "Indexing objects" when --stdin is specified.
77
78       --check-self-contained-and-connected
79           Die if the pack contains broken links. For internal use only.
80
81       --fsck-objects
82           For internal use only.
83
84           Die if the pack contains broken objects. If the pack contains a
85           tree pointing to a .gitmodules blob that does not exist, prints the
86           hash of that blob (for the caller to check) after the hash that
87           goes into the name of the pack/idx file (see "Notes").
88
89       --threads=<n>
90           Specifies the number of threads to spawn when resolving deltas.
91           This requires that index-pack be compiled with pthreads otherwise
92           this option is ignored with a warning. This is meant to reduce
93           packing time on multiprocessor machines. The required amount of
94           memory for the delta search window is however multiplied by the
95           number of threads. Specifying 0 will cause Git to auto-detect the
96           number of CPU’s and use maximum 3 threads.
97
98       --max-input-size=<size>
99           Die, if the pack is larger than <size>.
100
101       --object-format=<hash-algorithm>
102           Specify the given object format (hash algorithm) for the pack. The
103           valid values are sha1 and (if enabled) sha256. The default is the
104           algorithm for the current repository (set by
105           extensions.objectFormat), or sha1 if no value is set or outside a
106           repository.
107
108           This option cannot be used with --stdin.
109
110           THIS OPTION IS EXPERIMENTAL! SHA-256 support is experimental and
111           still in an early stage. A SHA-256 repository will in general not
112           be able to share work with "regular" SHA-1 repositories. It should
113           be assumed that, e.g., Git internal file formats in relation to
114           SHA-256 repositories may change in backwards-incompatible ways.
115           Only use --object-format=sha256 for testing purposes.
116
117       --promisor[=<message>]
118           Before committing the pack-index, create a .promisor file for this
119           pack. Particularly helpful when writing a promisor pack with
120           --fix-thin since the name of the pack is not final until the pack
121           has been fully written. If a <message> is provided, then that
122           content will be written to the .promisor file for future reference.
123           See partial clone[1] for more information.
124

NOTES

126       Once the index has been created, the hash that goes into the name of
127       the pack/idx file is printed to stdout. If --stdin was also used then
128       this is prefixed by either "pack\t", or "keep\t" if a new .keep file
129       was successfully created. This is useful to remove a .keep file used as
130       a lock to prevent the race with git repack mentioned above.
131

GIT

133       Part of the git(1) suite
134

NOTES

136        1. partial clone
137           file:///usr/share/doc/git/technical/partial-clone.html
138
139
140
141Git 2.36.1                        2022-05-05                 GIT-INDEX-PACK(1)
Impressum