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