{
    "mode": "man",
    "parameter": "git-multi-pack-index",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/git-multi-pack-index/1/json",
    "generated": "2026-05-30T06:06:45Z",
    "synopsis": "git multi-pack-index [--object-dir=<dir>] [--[no-]bitmap] <sub-command>",
    "sections": {
        "NAME": {
            "content": "git-multi-pack-index - Write and verify multi-pack-indexes\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "git multi-pack-index [--object-dir=<dir>] [--[no-]bitmap] <sub-command>\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Write or verify a multi-pack-index (MIDX) file.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "--object-dir=<dir>\nUse given directory for the location of Git objects. We check\n<dir>/packs/multi-pack-index for the current MIDX file, and <dir>/packs for the\npack-files to index.\n\n<dir> must be an alternate of the current repository.\n\n--[no-]progress\nTurn progress on/off explicitly. If neither is specified, progress is shown if standard\nerror is connected to a terminal. Supported by sub-commands write, verify, expire, and\n`repack.\n\nThe following subcommands are available:\n\nwrite\nWrite a new MIDX file. The following options are available for the write sub-command:\n\n--preferred-pack=<pack>\nOptionally specify the tie-breaking pack used when multiple packs contain the same\nobject.  <pack> must contain at least one object. If not given, ties are broken in\nfavor of the pack with the lowest mtime.\n\n--[no-]bitmap\nControl whether or not a multi-pack bitmap is written.\n\n--stdin-packs\nWrite a multi-pack index containing only the set of line-delimited pack index\nbasenames provided over stdin.\n\n--refs-snapshot=<path>\nWith --bitmap, optionally specify a file which contains a \"refs snapshot\" taken prior\nto repacking.\n\nA reference snapshot is composed of line-delimited OIDs corresponding to the\nreference tips, usually taken by git repack prior to generating a new pack. A line\nmay optionally start with a + character to indicate that the reference which\ncorresponds to that OID is \"preferred\" (see git-config(1)'s pack.preferBitmapTips.)\n\nThe file given at <path> is expected to be readable, and can contain duplicates. (If\na given OID is given more than once, it is marked as preferred if at least one\ninstance of it begins with the special + marker).\n\nverify\nVerify the contents of the MIDX file.\n\nexpire\nDelete the pack-files that are tracked by the MIDX file, but have no objects referenced\nby the MIDX. Rewrite the MIDX file afterward to remove all references to these\npack-files.\n\nrepack\nCreate a new pack-file containing objects in small pack-files referenced by the\nmulti-pack-index. If the size given by the --batch-size=<size> argument is zero, then\ncreate a pack containing all objects referenced by the multi-pack-index. For a non-zero\nbatch size, Select the pack-files by examining packs from oldest-to-newest, computing the\n\"expected size\" by counting the number of objects in the pack referenced by the\nmulti-pack-index, then divide by the total number of objects in the pack and multiply by\nthe pack size. We select packs with expected size below the batch size until the set of\npacks have total expected size at least the batch size, or all pack-files are considered.\nIf only one pack-file is selected, then do nothing. If a new pack-file is created,\nrewrite the multi-pack-index to reference the new pack-file. A later run of git\nmulti-pack-index expire will delete the pack-files that were part of this batch.\n\nIf repack.packKeptObjects is false, then any pack-files with an associated .keep file\nwill not be selected for the batch to repack.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "•   Write a MIDX file for the packfiles in the current .git directory.\n\n$ git multi-pack-index write\n\n\n•   Write a MIDX file for the packfiles in the current .git directory with a corresponding\nbitmap.\n\n$ git multi-pack-index write --preferred-pack=<pack> --bitmap\n\n\n•   Write a MIDX file for the packfiles in an alternate object store.\n\n$ git multi-pack-index --object-dir <alt> write\n\n\n•   Verify the MIDX file for the packfiles in the current .git directory.\n\n$ git multi-pack-index verify\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "See The Multi-Pack-Index Design Document[1] and The Multi-Pack-Index Format[2] for more\ninformation on the multi-pack-index feature.\n",
            "subsections": []
        },
        "GIT": {
            "content": "Part of the git(1) suite\n",
            "subsections": []
        },
        "NOTES": {
            "content": "1. The Multi-Pack-Index Design Document\nfile:///usr/share/doc/git/html/technical/multi-pack-index.html\n\n2. The Multi-Pack-Index Format\nfile:///usr/share/doc/git/html/technical/pack-format.html\n\n\n\nGit 2.34.1                                   02/26/2026                         GIT-MULTI-PACK-IN(1)",
            "subsections": []
        }
    },
    "summary": "git-multi-pack-index - Write and verify multi-pack-indexes",
    "flags": [],
    "examples": [
        "•   Write a MIDX file for the packfiles in the current .git directory.",
        "$ git multi-pack-index write",
        "•   Write a MIDX file for the packfiles in the current .git directory with a corresponding",
        "bitmap.",
        "$ git multi-pack-index write --preferred-pack=<pack> --bitmap",
        "•   Write a MIDX file for the packfiles in an alternate object store.",
        "$ git multi-pack-index --object-dir <alt> write",
        "•   Verify the MIDX file for the packfiles in the current .git directory.",
        "$ git multi-pack-index verify"
    ],
    "see_also": []
}