blob: 5a20deefd5f5dae5fb4cfbb3ccfaef4ab723f44f [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-index-pack(1)
2=================
3
4NAME
5----
6git-index-pack - Build pack index file for an existing packed archive
7
8
9SYNOPSIS
10--------
Junio C Hamanoa9b8d242007-05-19 04:51:5511[verse]
Junio C Hamanob4fc8e82021-02-12 22:46:4212'git index-pack' [-v] [-o <index-file>] [--[no-]rev-index] <pack-file>
Junio C Hamanofce7c7e2008-07-02 03:06:3813'git index-pack' --stdin [--fix-thin] [--keep] [-v] [-o <index-file>]
Junio C Hamanob4fc8e82021-02-12 22:46:4214 [--[no-]rev-index] [<pack-file>]
Junio C Hamano1a4e8412005-12-27 08:17:2315
16
17DESCRIPTION
18-----------
Junio C Hamano33be8212023-10-23 21:45:5419Reads a packed archive (.pack) from the specified file,
20builds a pack index file (.idx) for it, and optionally writes a
Junio C Hamanob4fc8e82021-02-12 22:46:4221reverse-index (.rev) for the specified pack. The packed
Junio C Hamano33be8212023-10-23 21:45:5422archive, together with the pack index, can then be placed in
Junio C Hamanob4fc8e82021-02-12 22:46:4223the objects/pack/ directory of a Git repository.
Junio C Hamano1a4e8412005-12-27 08:17:2324
25
26OPTIONS
27-------
Junio C Hamano0d3c8152006-11-08 01:33:4128-v::
29Be verbose about what is going on, including progress status.
30
Junio C Hamano1a4e8412005-12-27 08:17:2331-o <index-file>::
32Write the generated pack index into the specified
33file. Without this option the name of pack index
34file is constructed from the name of packed archive
35file by replacing .pack with .idx (and the program
36fails if the name of packed archive does not end
37with .pack).
38
Junio C Hamanob4fc8e82021-02-12 22:46:4239--[no-]rev-index::
40When 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
43reverse index is correct. Takes precedence over
44`pack.writeReverseIndex`.
45
Junio C Hamano0d3c8152006-11-08 01:33:4146--stdin::
47When this flag is provided, the pack is read from stdin
48instead and a copy is then written to <pack-file>. If
49<pack-file> is not specified, the pack is written to
Junio C Hamano076ffcc2013-02-06 05:13:2150objects/pack/ directory of the current Git repository with
Junio C Hamano0d3c8152006-11-08 01:33:4151a default name determined from the pack content. If
52<pack-file> is not specified consider using --keep to
53prevent a race condition between this process and
Junio C Hamano1aa40d22010-01-21 17:46:4354'git repack'.
Junio C Hamano0d3c8152006-11-08 01:33:4155
56--fix-thin::
Junio C Hamano4fdccb22010-02-19 09:58:1457Fix a "thin" pack produced by `git pack-objects --thin` (see
58linkgit:git-pack-objects[1] for details) by adding the
59excluded objects the deltified objects are based on to the
60pack. This option only makes sense in conjunction with --stdin.
Junio C Hamano0d3c8152006-11-08 01:33:4161
62--keep::
63Before moving the index into its final destination
64create an empty .keep file for the associated pack file.
65This option is usually necessary with --stdin to prevent a
Junio C Hamano1aa40d22010-01-21 17:46:4366simultaneous 'git repack' process from deleting
Junio C Hamano0d3c8152006-11-08 01:33:4167the newly constructed pack and index before refs can be
68updated to use objects contained in the pack.
69
Junio C Hamanod2179ef2010-10-22 04:12:1770--keep=<msg>::
Junio C Hamano33be8212023-10-23 21:45:5471Like --keep, create a .keep file before moving the index into
72its final destination. However, instead of creating an empty file
Junio C Hamanod2179ef2010-10-22 04:12:1773place '<msg>' followed by an LF into the .keep file. The '<msg>'
Junio C Hamano0d3c8152006-11-08 01:33:4174message can later be searched for within all .keep files to
75locate any which have outlived their usefulness.
76
Junio C Hamanoe90436a2007-04-22 07:22:1377--index-version=<version>[,<offset>]::
78This is intended to be used by the test suite only. It allows
79to force the version for the generated pack index, and to force
8064-bit index entries on objects located above the given offset.
81
Junio C Hamano6546a502024-02-08 23:48:3682--strict[=<msg-id>=<severity>...]::
83Die, if the pack contains broken objects or links. An optional
84comma-separated list of `<msg-id>=<severity>` can be passed to change
85the severity of some possible issues, e.g.,
86 `--strict="missingEmail=ignore,badTagName=error"`. See the entry for the
87`fsck.<msg-id>` configuration options in linkgit:git-fsck[1] for more
88information on the possible values of `<msg-id>` and `<severity>`.
Junio C Hamano4f1d8c42008-03-03 02:01:1689
Junio C Hamanode44de32021-09-20 22:46:0890--progress-title::
91For internal use only.
92+
93Set the title of the progress bar. The title is "Receiving objects" by
94default and "Indexing objects" when `--stdin` is specified.
95
Junio C Hamanob7277bf2013-06-06 22:34:5096--check-self-contained-and-connected::
97Die if the pack contains broken links. For internal use only.
98
Junio C Hamano6546a502024-02-08 23:48:3699--fsck-objects[=<msg-id>=<severity>...]::
100Die if the pack contains broken objects, but unlike `--strict`, don't
101choke on broken links. If the pack contains a tree pointing to a
102.gitmodules blob that does not exist, prints the hash of that blob
103(for the caller to check) after the hash that goes into the name of the
104pack/idx file (see "Notes").
Junio C Hamanob66f8a52021-03-03 07:07:49105+
Junio C Hamano6546a502024-02-08 23:48:36106An optional comma-separated list of `<msg-id>=<severity>` can be passed to
107change the severity of some possible issues, e.g.,
108`--fsck-objects="missingEmail=ignore,badTagName=ignore"`. See the entry for the
109`fsck.<msg-id>` configuration options in linkgit:git-fsck[1] for more
110information on the possible values of `<msg-id>` and `<severity>`.
Junio C Hamano81000162018-03-21 19:54:50111
Junio C Hamanof94fd6c2012-05-17 22:55:14112--threads=<n>::
113Specifies the number of threads to spawn when resolving
114deltas. This requires that index-pack be compiled with
115pthreads otherwise this option is ignored with a warning.
116This is meant to reduce packing time on multiprocessor
117machines. The required amount of memory for the delta search
118window is however multiplied by the number of threads.
Junio C Hamano076ffcc2013-02-06 05:13:21119Specifying 0 will cause Git to auto-detect the number of CPU's
Junio C Hamanof94fd6c2012-05-17 22:55:14120and use maximum 3 threads.
121
Junio C Hamanocd451662016-09-13 00:54:09122--max-input-size=<size>::
123Die, if the pack is larger than <size>.
Junio C Hamano0d3c8152006-11-08 01:33:41124
Junio C Hamanoa8911782020-07-07 05:35:57125--object-format=<hash-algorithm>::
126Specify the given object format (hash algorithm) for the pack. The valid
127values are 'sha1' and (if enabled) 'sha256'. The default is the algorithm for
128the current repository (set by `extensions.objectFormat`), or 'sha1' if no
129value is set or outside a repository.
130+
131This option cannot be used with --stdin.
Junio C Hamano48d7a8a2020-08-24 22:56:56132+
133include::object-format-disclaimer.txt[]
Junio C Hamanoa8911782020-07-07 05:35:57134
Junio C Hamano67fef492022-03-27 17:31:23135--promisor[=<message>]::
136Before committing the pack-index, create a .promisor file for this
137pack. Particularly helpful when writing a promisor pack with --fix-thin
138since the name of the pack is not final until the pack has been fully
139written. If a `<message>` is provided, then that content will be
140written to the .promisor file for future reference. See
141link:technical/partial-clone.html[partial clone] for more information.
142
Junio C Hamanob9d9d902018-05-23 07:07:42143NOTES
144-----
Junio C Hamano0d3c8152006-11-08 01:33:41145
Junio C Hamano9c649b42020-07-31 05:19:26146Once the index has been created, the hash that goes into the name of
147the pack/idx file is printed to stdout. If --stdin was
Junio C Hamano0d3c8152006-11-08 01:33:41148also used then this is prefixed by either "pack\t", or "keep\t" if a
149new .keep file was successfully created. This is useful to remove a
Junio C Hamano1aa40d22010-01-21 17:46:43150.keep file used as a lock to prevent the race with 'git repack'
Junio C Hamano0d3c8152006-11-08 01:33:41151mentioned above.
152
Junio C Hamano1a4e8412005-12-27 08:17:23153GIT
154---
Junio C Hamanof7c042d2008-06-06 22:50:53155Part of the linkgit:git[1] suite