<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect2 SYSTEM "../../../dtd/dblite.dtd">

<sect2 lang="en" id="git-multi-pack-index(1)">
    <title>git-multi-pack-index(1)</title>
    <date>2024-07-02</date>
<revhistory><revision><date>2024-07-02</date></revision></revhistory>
<indexterm>
<primary>git-multi-pack-index(1)</primary>
</indexterm>
<simplesect id="git-multi-pack-index(1)__name">
<title>NAME</title>
<simpara>git-multi-pack-index - Write and verify multi-pack-indexes</simpara>
</simplesect>
<simplesect id="git-multi-pack-index(1)__synopsis">
<title>SYNOPSIS</title>
<blockquote>
<literallayout><emphasis>git multi-pack-index</emphasis> [--object-dir=&lt;dir&gt;] [--[no-]bitmap] &lt;sub-command&gt;</literallayout>
</blockquote>
</simplesect>
<simplesect id="git-multi-pack-index(1)__description">
<title>DESCRIPTION</title>
<simpara>Write or verify a multi-pack-index (MIDX) file.</simpara>
</simplesect>
<simplesect id="git-multi-pack-index(1)__options">
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term>
--object-dir=&lt;dir&gt;
</term>
<listitem>
<simpara>
        Use given directory for the location of Git objects. We check
        <emphasis>&lt;dir&gt;/packs/multi-pack-index</emphasis> for the current MIDX file, and
        <emphasis>&lt;dir&gt;/packs</emphasis> for the pack-files to index.
</simpara>
<simpara><emphasis>&lt;dir&gt;</emphasis> must be an alternate of the current repository.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--[no-]progress
</term>
<listitem>
<simpara>
        Turn progress on/off explicitly. If neither is specified, progress is
        shown if standard error is connected to a terminal. Supported by
        sub-commands <emphasis>write</emphasis>, <emphasis>verify</emphasis>, <emphasis>expire</emphasis>, and `repack.
</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>The following subcommands are available:</simpara>
<variablelist>
<varlistentry>
<term>
write
</term>
<listitem>
<simpara>
        Write a new MIDX file. The following options are available for
        the <emphasis>write</emphasis> sub-command:
</simpara>
<variablelist>
<varlistentry>
<term>
--preferred-pack=&lt;pack&gt;
</term>
<listitem>
<simpara>
                Optionally specify the tie-breaking pack used when
                multiple packs contain the same object. <emphasis>&lt;pack&gt;</emphasis> must
                contain at least one object. If not given, ties are
                broken in favor of the pack with the lowest mtime.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--[no-]bitmap
</term>
<listitem>
<simpara>
                Control whether or not a multi-pack bitmap is written.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--stdin-packs
</term>
<listitem>
<simpara>
                Write a multi-pack index containing only the set of
                line-delimited pack index basenames provided over stdin.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--refs-snapshot=&lt;path&gt;
</term>
<listitem>
<simpara>
                With <emphasis>--bitmap</emphasis>, optionally specify a file which
                contains a "refs snapshot" taken prior to repacking.
</simpara>
<simpara>A reference snapshot is composed of line-delimited OIDs corresponding to
the reference tips, usually taken by <emphasis>git repack</emphasis> prior to generating a
new pack. A line may optionally start with a <emphasis>+</emphasis> character to indicate
that the reference which corresponds to that OID is "preferred" (see
<xref linkend="git-config(1)" />'s <emphasis>pack.preferBitmapTips</emphasis>.)</simpara>
<simpara>The file given at <emphasis>&lt;path&gt;</emphasis> is expected to be readable, and can contain
duplicates. (If a given OID is given more than once, it is marked as
preferred if at least one instance of it begins with the special <emphasis>+</emphasis>
marker).</simpara>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term>
verify
</term>
<listitem>
<simpara>
        Verify the contents of the MIDX file.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
expire
</term>
<listitem>
<simpara>
        Delete the pack-files that are tracked by the MIDX file, but
        have no objects referenced by the MIDX (with the exception of
        <emphasis>.keep</emphasis> packs and cruft packs). Rewrite the MIDX file afterward
        to remove all references to these pack-files.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
repack
</term>
<listitem>
<simpara>
        Create a new pack-file containing objects in small pack-files
        referenced by the multi-pack-index. If the size given by the
        <emphasis>--batch-size=&lt;size&gt;</emphasis> argument is zero, then create a pack
        containing all objects referenced by the multi-pack-index. For
        a non-zero batch size, Select the pack-files by examining packs
        from oldest-to-newest, computing the "expected size" by counting
        the number of objects in the pack referenced by the
        multi-pack-index, then divide by the total number of objects in
        the pack and multiply by the pack size. We select packs with
        expected size below the batch size until the set of packs have
        total expected size at least the batch size, or all pack-files
        are considered. If only one pack-file is selected, then do
        nothing. If a new pack-file is created, rewrite the
        multi-pack-index to reference the new pack-file. A later run of
        <emphasis>git multi-pack-index expire</emphasis> will delete the pack-files that
        were part of this batch.
</simpara>
<simpara>If <emphasis>repack.packKeptObjects</emphasis> is <emphasis>false</emphasis>, then any pack-files with an
associated <emphasis>.keep</emphasis> file will not be selected for the batch to repack.</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="git-multi-pack-index(1)__examples">
<title>EXAMPLES</title>
<itemizedlist>
<listitem>
<simpara>
Write a MIDX file for the packfiles in the current <emphasis>.git</emphasis> directory.
</simpara>
<screen>$ git multi-pack-index write</screen>
</listitem>
<listitem>
<simpara>
Write a MIDX file for the packfiles in the current <emphasis>.git</emphasis> directory with a
corresponding bitmap.
</simpara>
<screen>$ git multi-pack-index write --preferred-pack=&lt;pack&gt; --bitmap</screen>
</listitem>
<listitem>
<simpara>
Write a MIDX file for the packfiles in an alternate object store.
</simpara>
<screen>$ git multi-pack-index --object-dir &lt;alt&gt; write</screen>
</listitem>
<listitem>
<simpara>
Verify the MIDX file for the packfiles in the current <emphasis>.git</emphasis> directory.
</simpara>
<screen>$ git multi-pack-index verify</screen>
</listitem>
</itemizedlist>
</simplesect>
<simplesect id="git-multi-pack-index(1)__see_also">
<title>SEE ALSO</title>
<simpara>See <ulink url="https://www.kernel.org/pub/software/scm/git/docs/technical/multi-pack-index.html"><citetitle>The Multi-Pack-Index Design
Document</citetitle></ulink> and <xref linkend="gitformat-pack(5)" /> for more information on the
multi-pack-index feature and its file format.</simpara>
</simplesect>
<simplesect id="git-multi-pack-index(1)__git">
<title>GIT</title>
<simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
</simplesect>
</sect2>
