{
    "content": [
        {
            "type": "text",
            "text": "# git-pack-refs (info)\n\n## NAME\n\ngit-pack-refs - Pack heads and tags for efficient repository access\n\n## SYNOPSIS\n\ngit pack-refs [--all] [--no-prune]\n\n## DESCRIPTION\n\nTraditionally, tips of branches and tags (collectively known as refs)\nwere stored one file per ref in a (sub)directory under $GITDIR/refs\ndirectory. While many branch tips tend to be updated often, most tags\nand some branch tips are never updated. When a repository has hundreds\nor thousands of tags, this one-file-per-ref format both wastes storage\nand hurts performance.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (2 subsections)\n- **BUGS**\n- **GIT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "git-pack-refs",
        "section": "",
        "mode": "info",
        "summary": "git-pack-refs - Pack heads and tags for efficient repository access",
        "synopsis": "git pack-refs [--all] [--no-prune]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "",
                "long": "--all",
                "arg": null,
                "description": "The command by default packs all tags and refs that are already packed, and leaves other refs alone. This is because branches are expected to be actively developed and packing their tips does not help performance. This option causes branch tips to be packed as well. Useful for a repository with many branches of historical interests."
            },
            {
                "flag": "",
                "long": "--no-prune",
                "arg": null,
                "description": "The command usually removes loose refs under $GITDIR/refs hierarchy after packing them. This option tells it not to."
            }
        ],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "--all",
                        "lines": 7,
                        "long": "--all"
                    },
                    {
                        "name": "--no-prune",
                        "lines": 3,
                        "long": "--no-prune"
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "GIT",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "git-pack-refs - Pack heads and tags for efficient repository access\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "git pack-refs [--all] [--no-prune]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Traditionally, tips of branches and tags (collectively known as refs)\nwere stored one file per ref in a (sub)directory under $GITDIR/refs\ndirectory. While many branch tips tend to be updated often, most tags\nand some branch tips are never updated. When a repository has hundreds\nor thousands of tags, this one-file-per-ref format both wastes storage\nand hurts performance.\n\nThis command is used to solve the storage and performance problem by\nstoring the refs in a single file, $GITDIR/packed-refs. When a ref is\nmissing from the traditional $GITDIR/refs directory hierarchy, it is\nlooked up in this file and used if found.\n\nSubsequent updates to branches always create new files under\n$GITDIR/refs directory hierarchy.\n\nA recommended practice to deal with a repository with too many refs is\nto pack its refs with --all once, and occasionally run git pack-refs.\nTags are by definition stationary and are not expected to change.\nBranch heads will be packed with the initial pack-refs --all, but only\nthe currently active branch heads will become unpacked, and the next\npack-refs (without --all) will leave them unpacked.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "--all",
                        "content": "The command by default packs all tags and refs that are already\npacked, and leaves other refs alone. This is because branches are\nexpected to be actively developed and packing their tips does not\nhelp performance. This option causes branch tips to be packed as\nwell. Useful for a repository with many branches of historical\ninterests.\n",
                        "long": "--all"
                    },
                    {
                        "name": "--no-prune",
                        "content": "The command usually removes loose refs under $GITDIR/refs\nhierarchy after packing them. This option tells it not to.\n",
                        "long": "--no-prune"
                    }
                ]
            },
            "BUGS": {
                "content": "Older documentation written before the packed-refs mechanism was\nintroduced may still say things like \".git/refs/heads/<branch> file\nexists\" when it means \"branch <branch> exists\".\n",
                "subsections": []
            },
            "GIT": {
                "content": "Part of the git(1) suite\n\nGit 2.34.1                        02/26/2026                  GIT-PACK-REFS(1)",
                "subsections": []
            }
        }
    }
}