]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-index-pack.txt
Merge branch 'en/ort-perf-batch-9'
[thirdparty/git.git] / Documentation / git-index-pack.txt
CommitLineData
9cf6d335
SV
1git-index-pack(1)
2=================
3
4NAME
5----
6git-index-pack - Build pack index file for an existing packed archive
7
8
9SYNOPSIS
10--------
97925fde 11[verse]
e37d0b87 12'git index-pack' [-v] [-o <index-file>] [--[no-]rev-index] <pack-file>
b1889c36 13'git index-pack' --stdin [--fix-thin] [--keep] [-v] [-o <index-file>]
e37d0b87 14 [--[no-]rev-index] [<pack-file>]
9cf6d335
SV
15
16
17DESCRIPTION
18-----------
19Reads a packed archive (.pack) from the specified file, and
e37d0b87
TB
20builds a pack index file (.idx) for it. Optionally writes a
21reverse-index (.rev) for the specified pack. The packed
22archive together with the pack index can then be placed in
23the objects/pack/ directory of a Git repository.
9cf6d335
SV
24
25
26OPTIONS
27-------
3c9af366
NP
28-v::
29 Be verbose about what is going on, including progress status.
30
9cf6d335
SV
31-o <index-file>::
32 Write the generated pack index into the specified
33 file. Without this option the name of pack index
34 file is constructed from the name of packed archive
35 file by replacing .pack with .idx (and the program
36 fails if the name of packed archive does not end
37 with .pack).
38
e37d0b87
TB
39--[no-]rev-index::
40 When this flag is provided, generate a reverse index
41 (a `.rev` file) corresponding to the given pack. If
42 `--verify` is given, ensure that the existing
43 reverse index is correct. Takes precedence over
44 `pack.writeReverseIndex`.
45
e42797f5
NP
46--stdin::
47 When this flag is provided, the pack is read from stdin
48 instead and a copy is then written to <pack-file>. If
49 <pack-file> is not specified, the pack is written to
2de9b711 50 objects/pack/ directory of the current Git repository with
b8077709
SP
51 a default name determined from the pack content. If
52 <pack-file> is not specified consider using --keep to
53 prevent a race condition between this process and
0b444cdb 54 'git repack'.
9cf6d335 55
636171cb 56--fix-thin::
738820a9
SB
57 Fix a "thin" pack produced by `git pack-objects --thin` (see
58 linkgit:git-pack-objects[1] for details) by adding the
59 excluded objects the deltified objects are based on to the
60 pack. This option only makes sense in conjunction with --stdin.
b8077709
SP
61
62--keep::
63 Before moving the index into its final destination
64 create an empty .keep file for the associated pack file.
65 This option is usually necessary with --stdin to prevent a
0b444cdb 66 simultaneous 'git repack' process from deleting
b8077709
SP
67 the newly constructed pack and index before refs can be
68 updated to use objects contained in the pack.
69
62b4698e 70--keep=<msg>::
b8077709
SP
71 Like --keep create a .keep file before moving the index into
72 its final destination, but rather than creating an empty file
62b4698e 73 place '<msg>' followed by an LF into the .keep file. The '<msg>'
b8077709
SP
74 message can later be searched for within all .keep files to
75 locate any which have outlived their usefulness.
636171cb 76
be18c1fe
NP
77--index-version=<version>[,<offset>]::
78 This is intended to be used by the test suite only. It allows
79 to force the version for the generated pack index, and to force
80 64-bit index entries on objects located above the given offset.
81
0153be05
MK
82--strict::
83 Die, if the pack contains broken objects or links.
84
c6807a40
NTND
85--check-self-contained-and-connected::
86 Die if the pack contains broken links. For internal use only.
87
ffb2c0fe 88--fsck-objects::
5476e1ef
JT
89 For internal use only.
90+
91Die if the pack contains broken objects. If the pack contains a tree
92pointing to a .gitmodules blob that does not exist, prints the hash of
93that blob (for the caller to check) after the hash that goes into the
94name of the pack/idx file (see "Notes").
ffb2c0fe 95
b8a2486f
NTND
96--threads=<n>::
97 Specifies the number of threads to spawn when resolving
98 deltas. This requires that index-pack be compiled with
99 pthreads otherwise this option is ignored with a warning.
100 This is meant to reduce packing time on multiprocessor
101 machines. The required amount of memory for the delta search
102 window is however multiplied by the number of threads.
2de9b711 103 Specifying 0 will cause Git to auto-detect the number of CPU's
b8a2486f
NTND
104 and use maximum 3 threads.
105
411481be
JK
106--max-input-size=<size>::
107 Die, if the pack is larger than <size>.
636171cb 108
586740aa 109--object-format=<hash-algorithm>::
110 Specify the given object format (hash algorithm) for the pack. The valid
111 values are 'sha1' and (if enabled) 'sha256'. The default is the algorithm for
112 the current repository (set by `extensions.objectFormat`), or 'sha1' if no
113 value is set or outside a repository.
114+
115This option cannot be used with --stdin.
ff233d8d
116+
117include::object-format-disclaimer.txt[]
586740aa 118
76a8788c
NTND
119NOTES
120-----
576162a4 121
e2bfa50a
JB
122Once the index has been created, the hash that goes into the name of
123the pack/idx file is printed to stdout. If --stdin was
576162a4
NP
124also used then this is prefixed by either "pack\t", or "keep\t" if a
125new .keep file was successfully created. This is useful to remove a
0b444cdb 126.keep file used as a lock to prevent the race with 'git repack'
576162a4
NP
127mentioned above.
128
9cf6d335
SV
129GIT
130---
9e1f0a85 131Part of the linkgit:git[1] suite