]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-multi-pack-index.txt
Start the 2.46 cycle
[thirdparty/git.git] / Documentation / git-multi-pack-index.txt
CommitLineData
6a257f03
DS
1git-multi-pack-index(1)
2=======================
3
4NAME
5----
6git-multi-pack-index - Write and verify multi-pack-indexes
7
8
9SYNOPSIS
10--------
11[verse]
844cc433 12'git multi-pack-index' [--object-dir=<dir>] [--[no-]bitmap] <sub-command>
6a257f03
DS
13
14DESCRIPTION
15-----------
16Write or verify a multi-pack-index (MIDX) file.
17
18OPTIONS
19-------
20
21--object-dir=<dir>::
22 Use given directory for the location of Git objects. We check
23 `<dir>/packs/multi-pack-index` for the current MIDX file, and
24 `<dir>/packs` for the pack-files to index.
f57a7396
TB
25+
26`<dir>` must be an alternate of the current repository.
6a257f03 27
680cba2c
WB
28--[no-]progress::
29 Turn progress on/off explicitly. If neither is specified, progress is
0394f8d0
TB
30 shown if standard error is connected to a terminal. Supported by
31 sub-commands `write`, `verify`, `expire`, and `repack.
680cba2c 32
81efa161
DS
33The following subcommands are available:
34
a3407730 35write::
9218c6a4
TB
36 Write a new MIDX file. The following options are available for
37 the `write` sub-command:
38+
39--
40 --preferred-pack=<pack>::
41 Optionally specify the tie-breaking pack used when
5d3cd09a
TB
42 multiple packs contain the same object. `<pack>` must
43 contain at least one object. If not given, ties are
44 broken in favor of the pack with the lowest mtime.
c528e179
TB
45
46 --[no-]bitmap::
47 Control whether or not a multi-pack bitmap is written.
6fb22ca4
TB
48
49 --stdin-packs::
50 Write a multi-pack index containing only the set of
51 line-delimited pack index basenames provided over stdin.
08944d1c
TB
52
53 --refs-snapshot=<path>::
54 With `--bitmap`, optionally specify a file which
55 contains a "refs snapshot" taken prior to repacking.
56+
57A reference snapshot is composed of line-delimited OIDs corresponding to
58the reference tips, usually taken by `git repack` prior to generating a
59new pack. A line may optionally start with a `+` character to indicate
60that the reference which corresponds to that OID is "preferred" (see
61linkgit:git-config[1]'s `pack.preferBitmapTips`.)
62+
63The file given at `<path>` is expected to be readable, and can contain
64duplicates. (If a given OID is given more than once, it is marked as
65preferred if at least one instance of it begins with the special `+`
66marker).
9218c6a4 67--
a3407730 68
56ee7ff1 69verify::
81efa161 70 Verify the contents of the MIDX file.
56ee7ff1 71
cff97116 72expire::
26995428 73 Delete the pack-files that are tracked by the MIDX file, but
2a91b35f 74 have no objects referenced by the MIDX (with the exception of
757d4579
TB
75 `.keep` packs and cruft packs). Rewrite the MIDX file afterward
76 to remove all references to these pack-files.
cff97116 77
2af890bb
DS
78repack::
79 Create a new pack-file containing objects in small pack-files
80 referenced by the multi-pack-index. If the size given by the
81 `--batch-size=<size>` argument is zero, then create a pack
82 containing all objects referenced by the multi-pack-index. For
83 a non-zero batch size, Select the pack-files by examining packs
84 from oldest-to-newest, computing the "expected size" by counting
85 the number of objects in the pack referenced by the
86 multi-pack-index, then divide by the total number of objects in
87 the pack and multiply by the pack size. We select packs with
88 expected size below the batch size until the set of packs have
1eb22c7d
DS
89 total expected size at least the batch size, or all pack-files
90 are considered. If only one pack-file is selected, then do
91 nothing. If a new pack-file is created, rewrite the
92 multi-pack-index to reference the new pack-file. A later run of
93 'git multi-pack-index expire' will delete the pack-files that
94 were part of this batch.
3ce4ca0a
DS
95+
96If `repack.packKeptObjects` is `false`, then any pack-files with an
97associated `.keep` file will not be selected for the batch to repack.
2af890bb 98
a3407730
DS
99
100EXAMPLES
101--------
102
85bc0065 103* Write a MIDX file for the packfiles in the current `.git` directory.
a3407730
DS
104+
105-----------------------------------------------
106$ git multi-pack-index write
107-----------------------------------------------
108
85bc0065 109* Write a MIDX file for the packfiles in the current `.git` directory with a
c528e179
TB
110corresponding bitmap.
111+
112-------------------------------------------------------------
113$ git multi-pack-index write --preferred-pack=<pack> --bitmap
114-------------------------------------------------------------
115
a3407730
DS
116* Write a MIDX file for the packfiles in an alternate object store.
117+
118-----------------------------------------------
119$ git multi-pack-index --object-dir <alt> write
120-----------------------------------------------
121
85bc0065 122* Verify the MIDX file for the packfiles in the current `.git` directory.
56ee7ff1
DS
123+
124-----------------------------------------------
125$ git multi-pack-index verify
126-----------------------------------------------
127
6a257f03
DS
128
129SEE ALSO
130--------
131See link:technical/multi-pack-index.html[The Multi-Pack-Index Design
977c47b4
ÆAB
132Document] and linkgit:gitformat-pack[5] for more information on the
133multi-pack-index feature and its file format.
6a257f03
DS
134
135
136GIT
137---
138Part of the linkgit:git[1] suite