1GIT-INDEX-PACK(1) Git Manual GIT-INDEX-PACK(1)
2
3
4
6 git-index-pack - Build pack index file for an existing packed archive
7
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
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
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 --check-self-contained-and-connected
73 Die if the pack contains broken links. For internal use only.
74
75 --fsck-objects
76 For internal use only.
77
78 Die if the pack contains broken objects. If the pack contains a
79 tree pointing to a .gitmodules blob that does not exist, prints the
80 hash of that blob (for the caller to check) after the hash that
81 goes into the name of the pack/idx file (see "Notes").
82
83 --threads=<n>
84 Specifies the number of threads to spawn when resolving deltas.
85 This requires that index-pack be compiled with pthreads otherwise
86 this option is ignored with a warning. This is meant to reduce
87 packing time on multiprocessor machines. The required amount of
88 memory for the delta search window is however multiplied by the
89 number of threads. Specifying 0 will cause Git to auto-detect the
90 number of CPU’s and use maximum 3 threads.
91
92 --max-input-size=<size>
93 Die, if the pack is larger than <size>.
94
95 --object-format=<hash-algorithm>
96 Specify the given object format (hash algorithm) for the pack. The
97 valid values are sha1 and (if enabled) sha256. The default is the
98 algorithm for the current repository (set by
99 extensions.objectFormat), or sha1 if no value is set or outside a
100 repository.
101
102 This option cannot be used with --stdin.
103
104 THIS OPTION IS EXPERIMENTAL! SHA-256 support is experimental and
105 still in an early stage. A SHA-256 repository will in general not
106 be able to share work with "regular" SHA-1 repositories. It should
107 be assumed that, e.g., Git internal file formats in relation to
108 SHA-256 repositories may change in backwards-incompatible ways.
109 Only use --object-format=sha256 for testing purposes.
110
112 Once the index has been created, the hash that goes into the name of
113 the pack/idx file is printed to stdout. If --stdin was also used then
114 this is prefixed by either "pack\t", or "keep\t" if a new .keep file
115 was successfully created. This is useful to remove a .keep file used as
116 a lock to prevent the race with git repack mentioned above.
117
119 Part of the git(1) suite
120
121
122
123Git 2.33.1 2021-10-12 GIT-INDEX-PACK(1)