6 git-prune - Prune all unreachable objects from the object database
11 'git prune' [-n] [-v] [--expire <expire>] [--] [<head>...]
16 NOTE: In most cases, users should run 'git gc', which calls
17 'git prune'. See the section "NOTES", below.
19 This runs 'git fsck --unreachable' using all the refs
20 available in `refs/`, optionally with additional set of
21 objects specified on the command line, and prunes all unpacked
22 objects unreachable from any of these head objects from the object database.
24 prunes the unpacked objects that are also found in packs by
25 running 'git prune-packed'.
27 Note that unreachable, packed objects will remain. If this is
28 not desired, see linkgit:git-repack[1].
35 Do not remove anything; just report what it would
40 Report all removed objects.
43 Do not interpret any more arguments as options.
46 Only expire loose objects older than <time>.
49 In addition to objects
50 reachable from any of our references, keep objects
51 reachable from listed <head>s.
56 To prune objects not used by your repository nor another that
57 borrows from your repository via its
58 `.git/objects/info/alternates`:
61 $ git prune $(cd ../another && $(git rev-parse --all))
67 In most cases, users will not need to call 'git prune' directly, but
68 should instead call 'git gc', which handles pruning along with
69 many other housekeeping tasks.
71 For a description of which objects are considered for pruning, see
72 'git fsck''s --unreachable option.
83 Part of the linkgit:git[1] suite