1 git-prune(1)
2 ============
4 NAME
5 ----
6 git-prune - Prunes all unreachable objects from the object database
9 SYNOPSIS
10 --------
11 'git-prune' [-n] [--grace=<time>]
13 DESCRIPTION
14 -----------
16 This runs `git-fsck-objects --unreachable` using all the refs
17 available in `$GIT_DIR/refs`, optionally with additional set of
18 objects specified on the command line, and prunes all
19 objects unreachable from any of these head objects from the object database.
20 In addition, it
21 prunes the unpacked objects that are also found in packs by
22 running `git prune-packed`.
24 OPTIONS
25 -------
27 -n::
28 Do not remove anything; just report what it would
29 remove.
31 --grace=<time>::
32 Do not prune loose objects that are younger than the
33 specified time. This gives a grace period to newly
34 created objects from getting pruned.
36 ////////////////////////////////////////////
37 \--::
38 Do not interpret any more arguments as options.
40 <head>...::
41 In addition to objects
42 reachable from any of our references, keep objects
43 reachable from listed <head>s.
45 EXAMPLE
46 -------
48 To prune objects not used by your repository nor another that
49 borrows from your repository via its
50 `.git/objects/info/alternates`:
52 ------------
53 $ git prune $(cd ../another && $(git-rev-parse --all))
54 ------------
55 ////////////////////////////////////////////
57 Author
58 ------
59 Written by Linus Torvalds <torvalds@osdl.org>
61 Documentation
62 --------------
63 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
65 GIT
66 ---
67 Part of the gitlink:git[7] suite