Documentation / git-pack-refs.txton commit Merge branch 'sn/doc-update-index-assume-unchanged' (f6be8fb)
   1git-pack-refs(1)
   2================
   3
   4NAME
   5----
   6git-pack-refs - Pack heads and tags for efficient repository access
   7
   8SYNOPSIS
   9--------
  10[verse]
  11'git pack-refs' [--all] [--no-prune]
  12
  13DESCRIPTION
  14-----------
  15
  16Traditionally, tips of branches and tags (collectively known as
  17'refs') were stored one file per ref under `$GIT_DIR/refs`
  18directory.  While many branch tips tend to be updated often,
  19most tags and some branch tips are never updated.  When a
  20repository has hundreds or thousands of tags, this
  21one-file-per-ref format both wastes storage and hurts
  22performance.
  23
  24This command is used to solve the storage and performance
  25problem by stashing the refs in a single file,
  26`$GIT_DIR/packed-refs`.  When a ref is missing from the
  27traditional `$GIT_DIR/refs` hierarchy, it is looked up in this
  28file and used if found.
  29
  30Subsequent updates to branches always create new files under
  31`$GIT_DIR/refs` hierarchy.
  32
  33A recommended practice to deal with a repository with too many
  34refs is to pack its refs with `--all --prune` once, and
  35occasionally run `git pack-refs \--prune`.  Tags are by
  36definition stationary and are not expected to change.  Branch
  37heads will be packed with the initial `pack-refs --all`, but
  38only the currently active branch heads will become unpacked,
  39and the next `pack-refs` (without `--all`) will leave them
  40unpacked.
  41
  42
  43OPTIONS
  44-------
  45
  46--all::
  47
  48The command by default packs all tags and refs that are already
  49packed, and leaves other refs
  50alone.  This is because branches are expected to be actively
  51developed and packing their tips does not help performance.
  52This option causes branch tips to be packed as well.  Useful for
  53a repository with many branches of historical interests.
  54
  55--no-prune::
  56
  57The command usually removes loose refs under `$GIT_DIR/refs`
  58hierarchy after packing them.  This option tells it not to.
  59
  60GIT
  61---
  62Part of the linkgit:git[1] suite