prune: --grace=time
[git/git.git] / Documentation / git-prune.txt
CommitLineData
215a7ad1
JH
1git-prune(1)
2============
2cf565c5
DG
3
4NAME
5----
215a7ad1 6git-prune - Prunes all unreachable objects from the object database
2cf565c5
DG
7
8
9SYNOPSIS
10--------
9b088c4e 11'git-prune' [-n] [--grace=<time>]
2cf565c5
DG
12
13DESCRIPTION
14-----------
f85a4191 15
2b86976b
JH
16This runs `git-fsck-objects --unreachable` using all the refs
17available in `$GIT_DIR/refs`, optionally with additional set of
18objects specified on the command line, and prunes all
19objects unreachable from any of these head objects from the object database.
20In addition, it
f85a4191
JH
21prunes the unpacked objects that are also found in packs by
22running `git prune-packed`.
23
24OPTIONS
25-------
26
27-n::
28 Do not remove anything; just report what it would
29 remove.
2cf565c5 30
9b088c4e
ML
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.
35
36////////////////////////////////////////////
e994004f 37\--::
c82365dc
JH
38 Do not interpret any more arguments as options.
39
40<head>...::
2b86976b 41 In addition to objects
c82365dc 42 reachable from any of our references, keep objects
2b86976b 43 reachable from listed <head>s.
c82365dc
JH
44
45EXAMPLE
46-------
47
2b86976b 48To prune objects not used by your repository nor another that
c82365dc
JH
49borrows from your repository via its
50`.git/objects/info/alternates`:
51
52------------
2b86976b 53$ git prune $(cd ../another && $(git-rev-parse --all))
c82365dc 54------------
9b088c4e 55////////////////////////////////////////////
2cf565c5
DG
56
57Author
58------
59Written by Linus Torvalds <torvalds@osdl.org>
60
61Documentation
62--------------
63Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
64
65GIT
66---
a7154e91 67Part of the gitlink:git[7] suite
2cf565c5 68