Documentation / git-prune.txton commit Merge branch 'bd/tests' (761adeb)
   1git-prune(1)
   2============
   3
   4NAME
   5----
   6git-prune - Prune all unreachable objects from the object database
   7
   8
   9SYNOPSIS
  10--------
  11'git-prune' [-n] [--expire <expire>] [--] [<head>...]
  12
  13DESCRIPTION
  14-----------
  15
  16NOTE: In most cases, users should run linkgit:git-gc[1], which calls
  17git-prune. See the section "NOTES", below.
  18
  19This runs `git-fsck --unreachable` using all the refs
  20available in `$GIT_DIR/refs`, optionally with additional set of
  21objects specified on the command line, and prunes all
  22objects unreachable from any of these head objects from the object database.
  23In addition, it
  24prunes the unpacked objects that are also found in packs by
  25running `git prune-packed`.
  26
  27OPTIONS
  28-------
  29
  30-n::
  31        Do not remove anything; just report what it would
  32        remove.
  33
  34\--::
  35        Do not interpret any more arguments as options.
  36
  37\--expire <time>::
  38        Only expire loose objects older than <time>.
  39
  40<head>...::
  41        In addition to objects
  42        reachable from any of our references, keep objects
  43        reachable from listed <head>s.
  44
  45EXAMPLE
  46-------
  47
  48To prune objects not used by your repository nor another that
  49borrows from your repository via its
  50`.git/objects/info/alternates`:
  51
  52------------
  53$ git prune $(cd ../another && $(git-rev-parse --all))
  54------------
  55
  56Notes
  57-----
  58
  59In most cases, users will not need to call git-prune directly, but
  60should instead call linkgit:git-gc[1], which handles pruning along with
  61many other housekeeping tasks.
  62
  63For a description of which objects are considered for pruning, see
  64git-fsck's --unreachable option.
  65
  66See Also
  67--------
  68
  69linkgit:git-fsck[1],
  70linkgit:git-gc[1],
  71linkgit:git-reflog[1]
  72
  73Author
  74------
  75Written by Linus Torvalds <torvalds@osdl.org>
  76
  77Documentation
  78--------------
  79Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
  80
  81GIT
  82---
  83Part of the linkgit:git[7] suite