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