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