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, builds a pack
15       index file (.idx) for it, and optionally writes a reverse-index (.rev)
16       for the specified pack. The packed archive, together with the pack
17       index, can then be placed in the objects/pack/ directory of a Git
18       repository.
19

OPTIONS

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

NOTES

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

GIT

137       Part of the git(1) suite
138

NOTES

140        1. partial clone
141           file:///usr/share/doc/git/technical/partial-clone.html
142
143
144
145Git 2.43.0                        11/20/2023                 GIT-INDEX-PACK(1)
Impressum