6 git-prune - Prunes all unreachable objects from the object database
11 'git-prune' [-n] [--] [<head>...]
16 This runs `git-fsck-objects --unreachable` using the heads
17 specified on the command line (or `$GIT_DIR/refs/heads/\*` and
18 `$GIT_DIR/refs/tags/\*` if none is specified), and prunes all
19 unreachable objects from the object database. In addition, it
20 prunes the unpacked objects that are also found in packs by
21 running `git prune-packed`.
27 Do not remove anything; just report what it would
31 Do not interpret any more arguments as options.
34 Instead of keeping objects
35 reachable from any of our references, keep objects
36 reachable from only listed <head>s.
38 Note that the explicitly named <head>s are *not* appended to the
39 default set of references, but they replace them. In general you
40 would want to say `git prune $(git-rev-parse --all) extra1
41 extra2` to keep chains of commits leading to extra1, extra2,
42 ... in addition to what are reachable from your own refs.
43 Saying `git prune extra1 extra2` would *lose* objects reachable
44 only from the usual refs, which is usually not what you want.
50 To prune objects not used by your repository and another that
51 borrows from your repository via its
52 `.git/objects/info/alternates`:
55 $ git prune $(git-rev-parse --all) \
56 $(cd ../another && $(git-rev-parse --all))
61 Written by Linus Torvalds <torvalds@osdl.org>
65 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
69 Part of the gitlink:git[7] suite