Git fork
1git-index-pack(1)
2=================
3
4NAME
5----
6git-index-pack - Build pack index file for an existing packed archive
7
8
9SYNOPSIS
10--------
11[verse]
12'git index-pack' [-v] [-o <index-file>] [--[no-]rev-index] <pack-file>
13'git index-pack' --stdin [--fix-thin] [--keep] [-v] [-o <index-file>]
14 [--[no-]rev-index] [<pack-file>]
15
16
17DESCRIPTION
18-----------
19Reads a packed archive (.pack) from the specified file,
20builds a pack index file (.idx) for it, and 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.
24
25
26OPTIONS
27-------
28-v::
29 Be verbose about what is going on, including progress status.
30
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
39--rev-index::
40--no-rev-index::
41 When this flag is provided, generate a reverse index
42 (a `.rev` file) corresponding to the given pack. If
43 `--verify` is given, ensure that the existing
44 reverse index is correct. Takes precedence over
45 `pack.writeReverseIndex`.
46
47--stdin::
48 When this flag is provided, the pack is read from stdin
49 instead and a copy is then written to <pack-file>. If
50 <pack-file> is not specified, the pack is written to
51 objects/pack/ directory of the current Git repository with
52 a default name determined from the pack content. If
53 <pack-file> is not specified consider using --keep to
54 prevent a race condition between this process and
55 'git repack'.
56
57--fix-thin::
58 Fix a "thin" pack produced by `git pack-objects --thin` (see
59 linkgit:git-pack-objects[1] for details) by adding the
60 excluded objects the deltified objects are based on to the
61 pack. This option only makes sense in conjunction with --stdin.
62
63--keep::
64 Before moving the index into its final destination
65 create an empty .keep file for the associated pack file.
66 This option is usually necessary with --stdin to prevent a
67 simultaneous 'git repack' process from deleting
68 the newly constructed pack and index before refs can be
69 updated to use objects contained in the pack.
70
71--keep=<msg>::
72 Like --keep, create a .keep file before moving the index into
73 its final destination. However, instead of creating an empty file
74 place '<msg>' followed by an LF into the .keep file. The '<msg>'
75 message can later be searched for within all .keep files to
76 locate any which have outlived their usefulness.
77
78--index-version=<version>[,<offset>]::
79 This is intended to be used by the test suite only. It allows
80 to force the version for the generated pack index, and to force
81 64-bit index entries on objects located above the given offset.
82
83--strict[=<msg-id>=<severity>...]::
84 Die, if the pack contains broken objects or links. An optional
85 comma-separated list of `<msg-id>=<severity>` can be passed to change
86 the severity of some possible issues, e.g.,
87 `--strict="missingEmail=ignore,badTagName=error"`. See the entry for the
88 `fsck.<msg-id>` configuration options in linkgit:git-fsck[1] for more
89 information on the possible values of `<msg-id>` and `<severity>`.
90
91--progress-title::
92 For internal use only.
93+
94Set the title of the progress bar. The title is "Receiving objects" by
95default and "Indexing objects" when `--stdin` is specified.
96
97--check-self-contained-and-connected::
98 Die if the pack contains broken links. For internal use only.
99
100--fsck-objects[=<msg-id>=<severity>...]::
101 Die if the pack contains broken objects, but unlike `--strict`, don't
102 choke on broken links. If the pack contains a tree pointing to a
103 .gitmodules blob that does not exist, prints the hash of that blob
104 (for the caller to check) after the hash that goes into the name of the
105 pack/idx file (see "Notes").
106+
107An optional comma-separated list of `<msg-id>=<severity>` can be passed to
108change the severity of some possible issues, e.g.,
109`--fsck-objects="missingEmail=ignore,badTagName=ignore"`. See the entry for the
110`fsck.<msg-id>` configuration options in linkgit:git-fsck[1] for more
111information on the possible values of `<msg-id>` and `<severity>`.
112
113--threads=<n>::
114 Specifies the number of threads to spawn when resolving
115 deltas. This requires that index-pack be compiled with
116 pthreads otherwise this option is ignored with a warning.
117 This is meant to reduce packing time on multiprocessor
118 machines. The required amount of memory for the delta search
119 window is however multiplied by the number of threads.
120 Specifying 0 will cause Git to auto-detect the number of CPU's
121 and use maximum 3 threads.
122
123--max-input-size=<size>::
124 Die, if the pack is larger than <size>.
125
126--object-format=<hash-algorithm>::
127 Specify the given object format (hash algorithm) for the pack. The valid
128 values are 'sha1' and (if enabled) 'sha256'. The default is the algorithm for
129 the current repository (set by `extensions.objectFormat`), or 'sha1' if no
130 value is set or outside a repository.
131+
132This option cannot be used with --stdin.
133+
134include::object-format-disclaimer.adoc[]
135
136--promisor[=<message>]::
137 Before committing the pack-index, create a .promisor file for this
138 pack. Particularly helpful when writing a promisor pack with --fix-thin
139 since the name of the pack is not final until the pack has been fully
140 written. If a `<message>` is provided, then that content will be
141 written to the .promisor file for future reference. See
142 link:technical/partial-clone.html[partial clone] for more information.
143+
144Also, if there are objects in the given pack that references non-promisor
145objects (in the repo), repacks those non-promisor objects into a promisor
146pack. This avoids a situation in which a repo has non-promisor objects that are
147accessible through promisor objects.
148+
149Requires <pack-file> to not be specified.
150
151NOTES
152-----
153
154Once the index has been created, the hash that goes into the name of
155the pack/idx file is printed to stdout. If --stdin was
156also used then this is prefixed by either "pack\t", or "keep\t" if a
157new .keep file was successfully created. This is useful to remove a
158.keep file used as a lock to prevent the race with 'git repack'
159mentioned above.
160
161GIT
162---
163Part of the linkgit:git[1] suite