Documentation / git-prune.txton commit Merge branch 'jk/combine-diff-binary-etc' (dbae1a1)
   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] [-v] [--expire <expire>] [--] [<head>...]
  12
  13DESCRIPTION
  14-----------
  15
  16NOTE: In most cases, users should run 'git gc', which calls
  17'git prune'. See the section "NOTES", below.
  18
  19This runs 'git fsck --unreachable' using all the refs
  20available in `refs/`, optionally with additional set of
  21objects specified on the command line, and prunes all unpacked
  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
  27Note that unreachable, packed objects will remain.  If this is
  28not desired, see linkgit:git-repack[1].
  29
  30OPTIONS
  31-------
  32
  33-n::
  34--dry-run::
  35        Do not remove anything; just report what it would
  36        remove.
  37
  38-v::
  39--verbose::
  40        Report all removed objects.
  41
  42\--::
  43        Do not interpret any more arguments as options.
  44
  45--expire <time>::
  46        Only expire loose objects older than <time>.
  47
  48<head>...::
  49        In addition to objects
  50        reachable from any of our references, keep objects
  51        reachable from listed <head>s.
  52
  53EXAMPLE
  54-------
  55
  56To prune objects not used by your repository nor another that
  57borrows from your repository via its
  58`.git/objects/info/alternates`:
  59
  60------------
  61$ git prune $(cd ../another && $(git rev-parse --all))
  62------------
  63
  64Notes
  65-----
  66
  67In most cases, users will not need to call 'git prune' directly, but
  68should instead call 'git gc', which handles pruning along with
  69many other housekeeping tasks.
  70
  71For a description of which objects are considered for pruning, see
  72'git fsck''s --unreachable option.
  73
  74SEE ALSO
  75--------
  76
  77linkgit:git-fsck[1],
  78linkgit:git-gc[1],
  79linkgit:git-reflog[1]
  80
  81GIT
  82---
  83Part of the linkgit:git[1] suite