blob: 54f1dab38de9e01d8452753ac6028875b91d5f6b [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-prune(1)
2============
3
4NAME
5----
Junio C Hamano4ec06712007-06-09 20:39:336git-prune - Prune all unreachable objects from the object database
Junio C Hamano1a4e8412005-12-27 08:17:237
8
9SYNOPSIS
10--------
Junio C Hamano0c999702007-12-03 09:57:5511'git-prune' [-n] [--expire <expire>] [--] [<head>...]
Junio C Hamano1a4e8412005-12-27 08:17:2312
13DESCRIPTION
14-----------
15
Junio C Hamanoba4b9282008-07-06 05:20:3116NOTE: In most cases, users should run 'git-gc', which calls
17'git-prune'. See the section "NOTES", below.
Junio C Hamano7d575a52008-04-30 08:45:2718
Junio C Hamanoba4b9282008-07-06 05:20:3119This runs 'git-fsck --unreachable' using all the refs
Junio C Hamano1a4e8412005-12-27 08:17:2320available in `$GIT_DIR/refs`, optionally with additional set of
Junio C Hamano229a72f2008-05-16 00:47:5621objects specified on the command line, and prunes all unpacked
Junio C Hamano1a4e8412005-12-27 08:17:2322objects unreachable from any of these head objects from the object database.
23In addition, it
24prunes the unpacked objects that are also found in packs by
Junio C Hamanoba4b9282008-07-06 05:20:3125running 'git-prune-packed'.
Junio C Hamano1a4e8412005-12-27 08:17:2326
Junio C Hamano229a72f2008-05-16 00:47:5627Note that unreachable, packed objects will remain. If this is
28not desired, see linkgit:git-repack[1].
29
Junio C Hamano1a4e8412005-12-27 08:17:2330OPTIONS
31-------
32
33-n::
34Do not remove anything; just report what it would
35remove.
36
Junio C Hamano1bb569e2006-05-05 23:14:2537\--::
Junio C Hamano1a4e8412005-12-27 08:17:2338Do not interpret any more arguments as options.
39
Junio C Hamanoeb415992008-06-08 22:49:4740--expire <time>::
Junio C Hamano0c999702007-12-03 09:57:5541Only expire loose objects older than <time>.
42
Junio C Hamano1a4e8412005-12-27 08:17:2343<head>...::
44In addition to objects
45reachable from any of our references, keep objects
46reachable from listed <head>s.
47
48EXAMPLE
49-------
50
51To prune objects not used by your repository nor another that
52borrows from your repository via its
53`.git/objects/info/alternates`:
54
55------------
Junio C Hamanofce7c7e2008-07-02 03:06:3856$ git prune $(cd ../another && $(git rev-parse --all))
Junio C Hamano1a4e8412005-12-27 08:17:2357------------
Junio C Hamano1a4e8412005-12-27 08:17:2358
Junio C Hamano7d575a52008-04-30 08:45:2759Notes
60-----
61
Junio C Hamanoba4b9282008-07-06 05:20:3162In most cases, users will not need to call 'git-prune' directly, but
63should instead call 'git-gc', which handles pruning along with
Junio C Hamano7d575a52008-04-30 08:45:2764many other housekeeping tasks.
65
66For a description of which objects are considered for pruning, see
Junio C Hamanoba4b9282008-07-06 05:20:3167'git-fsck''s --unreachable option.
Junio C Hamano7d575a52008-04-30 08:45:2768
Junio C Hamano9049d912008-05-29 02:09:5069SEE ALSO
Junio C Hamano7d575a52008-04-30 08:45:2770--------
71
72linkgit:git-fsck[1],
73linkgit:git-gc[1],
74linkgit:git-reflog[1]
75
Junio C Hamano1a4e8412005-12-27 08:17:2376Author
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---
Junio C Hamanof7c042d2008-06-06 22:50:5386Part of the linkgit:git[1] suite