The 20th batch
[alt-git.git] / Documentation / git-multi-pack-index.txt
blob631d5c7d15c0de14529793061e80769560ec80b3
1 git-multi-pack-index(1)
2 =======================
4 NAME
5 ----
6 git-multi-pack-index - Write and verify multi-pack-indexes
9 SYNOPSIS
10 --------
11 [verse]
12 'git multi-pack-index' [--object-dir=<dir>] [--[no-]bitmap] <sub-command>
14 DESCRIPTION
15 -----------
16 Write or verify a multi-pack-index (MIDX) file.
18 OPTIONS
19 -------
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.
26 `<dir>` must be an alternate of the current repository.
28 --[no-]progress::
29         Turn progress on/off explicitly. If neither is specified, progress is
30         shown if standard error is connected to a terminal. Supported by
31         sub-commands `write`, `verify`, `expire`, and `repack.
33 The following subcommands are available:
35 write::
36         Write a new MIDX file. The following options are available for
37         the `write` sub-command:
40         --preferred-pack=<pack>::
41                 Optionally specify the tie-breaking pack used when
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.
46         --[no-]bitmap::
47                 Control whether or not a multi-pack bitmap is written.
49         --stdin-packs::
50                 Write a multi-pack index containing only the set of
51                 line-delimited pack index basenames provided over stdin.
53         --refs-snapshot=<path>::
54                 With `--bitmap`, optionally specify a file which
55                 contains a "refs snapshot" taken prior to repacking.
57 A reference snapshot is composed of line-delimited OIDs corresponding to
58 the reference tips, usually taken by `git repack` prior to generating a
59 new pack. A line may optionally start with a `+` character to indicate
60 that the reference which corresponds to that OID is "preferred" (see
61 linkgit:git-config[1]'s `pack.preferBitmapTips`.)
63 The file given at `<path>` is expected to be readable, and can contain
64 duplicates. (If a given OID is given more than once, it is marked as
65 preferred if at least one instance of it begins with the special `+`
66 marker).
68         --incremental::
69                 Write an incremental MIDX file containing only objects
70                 and packs not present in an existing MIDX layer.
71                 Migrates non-incremental MIDXs to incremental ones when
72                 necessary. Incompatible with `--bitmap`.
75 verify::
76         Verify the contents of the MIDX file.
78 expire::
79         Delete the pack-files that are tracked by the MIDX file, but
80         have no objects referenced by the MIDX (with the exception of
81         `.keep` packs and cruft packs). Rewrite the MIDX file afterward
82         to remove all references to these pack-files.
84 NOTE: this mode is incompatible with incremental MIDX files.
86 repack::
87         Create a new pack-file containing objects in small pack-files
88         referenced by the multi-pack-index. If the size given by the
89         `--batch-size=<size>` argument is zero, then create a pack
90         containing all objects referenced by the multi-pack-index. For
91         a non-zero batch size, Select the pack-files by examining packs
92         from oldest-to-newest, computing the "expected size" by counting
93         the number of objects in the pack referenced by the
94         multi-pack-index, then divide by the total number of objects in
95         the pack and multiply by the pack size. We select packs with
96         expected size below the batch size until the set of packs have
97         total expected size at least the batch size, or all pack-files
98         are considered. If only one pack-file is selected, then do
99         nothing. If a new pack-file is created, rewrite the
100         multi-pack-index to reference the new pack-file. A later run of
101         'git multi-pack-index expire' will delete the pack-files that
102         were part of this batch.
104 If `repack.packKeptObjects` is `false`, then any pack-files with an
105 associated `.keep` file will not be selected for the batch to repack.
107 NOTE: this mode is incompatible with incremental MIDX files.
109 EXAMPLES
110 --------
112 * Write a MIDX file for the packfiles in the current `.git` directory.
114 -----------------------------------------------
115 $ git multi-pack-index write
116 -----------------------------------------------
118 * Write a MIDX file for the packfiles in the current `.git` directory with a
119 corresponding bitmap.
121 -------------------------------------------------------------
122 $ git multi-pack-index write --preferred-pack=<pack> --bitmap
123 -------------------------------------------------------------
125 * Write a MIDX file for the packfiles in an alternate object store.
127 -----------------------------------------------
128 $ git multi-pack-index --object-dir <alt> write
129 -----------------------------------------------
131 * Verify the MIDX file for the packfiles in the current `.git` directory.
133 -----------------------------------------------
134 $ git multi-pack-index verify
135 -----------------------------------------------
138 SEE ALSO
139 --------
140 See link:technical/multi-pack-index.html[The Multi-Pack-Index Design
141 Document] and linkgit:gitformat-pack[5] for more information on the
142 multi-pack-index feature and its file format.
147 Part of the linkgit:git[1] suite