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