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