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