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