]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-prune.txt
Merge branch 'maint'
[thirdparty/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
ba020ef5
JN
16NOTE: In most cases, users should run 'git-gc', which calls
17'git-prune'. See the section "NOTES", below.
8d308b35 18
ba020ef5 19This runs 'git-fsck --unreachable' using all the refs
2b86976b 20available in `$GIT_DIR/refs`, optionally with additional set of
58949bb1 21objects specified on the command line, and prunes all unpacked
2b86976b
JH
22objects unreachable from any of these head objects from the object database.
23In addition, it
f85a4191 24prunes the unpacked objects that are also found in packs by
ba020ef5 25running 'git-prune-packed'.
f85a4191 26
58949bb1
CF
27Note that unreachable, packed objects will remain. If this is
28not desired, see linkgit:git-repack[1].
29
f85a4191
JH
30OPTIONS
31-------
32
33-n::
34 Do not remove anything; just report what it would
35 remove.
2cf565c5 36
e994004f 37\--::
c82365dc
JH
38 Do not interpret any more arguments as options.
39
3240240f 40--expire <time>::
f01913e4
JS
41 Only expire loose objects older than <time>.
42
c82365dc 43<head>...::
2b86976b 44 In addition to objects
c82365dc 45 reachable from any of our references, keep objects
2b86976b 46 reachable from listed <head>s.
c82365dc
JH
47
48EXAMPLE
49-------
50
2b86976b 51To prune objects not used by your repository nor another that
c82365dc
JH
52borrows from your repository via its
53`.git/objects/info/alternates`:
54
55------------
b1889c36 56$ git prune $(cd ../another && $(git rev-parse --all))
c82365dc 57------------
2cf565c5 58
8d308b35
JK
59Notes
60-----
61
ba020ef5
JN
62In most cases, users will not need to call 'git-prune' directly, but
63should instead call 'git-gc', which handles pruning along with
8d308b35
JK
64many other housekeeping tasks.
65
66For a description of which objects are considered for pruning, see
ba020ef5 67'git-fsck''s --unreachable option.
8d308b35 68
56ae8df5 69SEE ALSO
8d308b35
JK
70--------
71
72linkgit:git-fsck[1],
73linkgit:git-gc[1],
74linkgit:git-reflog[1]
75
2cf565c5
DG
76Author
77------
78Written by Linus Torvalds <torvalds@osdl.org>
79
80Documentation
81--------------
82Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
83
84GIT
85---
9e1f0a85 86Part of the linkgit:git[1] suite