Documentation on --git-dir and --work-tree
[git/git.git] / Documentation / git-prune.txt
CommitLineData
215a7ad1
JH
1git-prune(1)
2============
2cf565c5
DG
3
4NAME
5----
29cf5e12 6git-prune - Prune all unreachable objects from the object database
2cf565c5
DG
7
8
9SYNOPSIS
10--------
f01913e4 11'git-prune' [-n] [--expire <expire>] [--] [<head>...]
2cf565c5
DG
12
13DESCRIPTION
14-----------
f85a4191 15
df391b19 16This runs `git-fsck --unreachable` using all the refs
2b86976b
JH
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
e994004f 31\--::
c82365dc
JH
32 Do not interpret any more arguments as options.
33
f01913e4
JS
34\--expire <time>::
35 Only expire loose objects older than <time>.
36
c82365dc 37<head>...::
2b86976b 38 In addition to objects
c82365dc 39 reachable from any of our references, keep objects
2b86976b 40 reachable from listed <head>s.
c82365dc
JH
41
42EXAMPLE
43-------
44
2b86976b 45To prune objects not used by your repository nor another that
c82365dc
JH
46borrows from your repository via its
47`.git/objects/info/alternates`:
48
49------------
2b86976b 50$ git prune $(cd ../another && $(git-rev-parse --all))
c82365dc 51------------
2cf565c5
DG
52
53Author
54------
55Written by Linus Torvalds <torvalds@osdl.org>
56
57Documentation
58--------------
59Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
60
61GIT
62---
5162e697 63Part of the linkgit:git[7] suite