Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-prune(1) |
| 2 | ============ |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | 4ec0671 | 2007-06-09 20:39:33 | [diff] [blame] | 6 | git-prune - Prune all unreachable objects from the object database |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | 0c99970 | 2007-12-03 09:57:55 | [diff] [blame] | 11 | 'git-prune' [-n] [--expire <expire>] [--] [<head>...] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 12 | |
| 13 | DESCRIPTION |
| 14 | ----------- |
| 15 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 16 | NOTE: In most cases, users should run 'git-gc', which calls |
| 17 | 'git-prune'. See the section "NOTES", below. |
Junio C Hamano | 7d575a5 | 2008-04-30 08:45:27 | [diff] [blame] | 18 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 19 | This runs 'git-fsck --unreachable' using all the refs |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 20 | available in `$GIT_DIR/refs`, optionally with additional set of |
Junio C Hamano | 229a72f | 2008-05-16 00:47:56 | [diff] [blame] | 21 | objects specified on the command line, and prunes all unpacked |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 22 | objects unreachable from any of these head objects from the object database. |
| 23 | In addition, it |
| 24 | prunes the unpacked objects that are also found in packs by |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 25 | running 'git-prune-packed'. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 26 | |
Junio C Hamano | 229a72f | 2008-05-16 00:47:56 | [diff] [blame] | 27 | Note that unreachable, packed objects will remain. If this is |
| 28 | not desired, see linkgit:git-repack[1]. |
| 29 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 30 | OPTIONS |
| 31 | ------- |
| 32 | |
| 33 | -n:: |
| 34 | Do not remove anything; just report what it would |
| 35 | remove. |
| 36 | |
Junio C Hamano | 1bb569e | 2006-05-05 23:14:25 | [diff] [blame] | 37 | \--:: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 38 | Do not interpret any more arguments as options. |
| 39 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 40 | --expire <time>:: |
Junio C Hamano | 0c99970 | 2007-12-03 09:57:55 | [diff] [blame] | 41 | Only expire loose objects older than <time>. |
| 42 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 43 | <head>...:: |
| 44 | In addition to objects |
| 45 | reachable from any of our references, keep objects |
| 46 | reachable from listed <head>s. |
| 47 | |
| 48 | EXAMPLE |
| 49 | ------- |
| 50 | |
| 51 | To prune objects not used by your repository nor another that |
| 52 | borrows from your repository via its |
| 53 | `.git/objects/info/alternates`: |
| 54 | |
| 55 | ------------ |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 56 | $ git prune $(cd ../another && $(git rev-parse --all)) |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 57 | ------------ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 58 | |
Junio C Hamano | 7d575a5 | 2008-04-30 08:45:27 | [diff] [blame] | 59 | Notes |
| 60 | ----- |
| 61 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 62 | In most cases, users will not need to call 'git-prune' directly, but |
| 63 | should instead call 'git-gc', which handles pruning along with |
Junio C Hamano | 7d575a5 | 2008-04-30 08:45:27 | [diff] [blame] | 64 | many other housekeeping tasks. |
| 65 | |
| 66 | For a description of which objects are considered for pruning, see |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 67 | 'git-fsck''s --unreachable option. |
Junio C Hamano | 7d575a5 | 2008-04-30 08:45:27 | [diff] [blame] | 68 | |
Junio C Hamano | 9049d91 | 2008-05-29 02:09:50 | [diff] [blame] | 69 | SEE ALSO |
Junio C Hamano | 7d575a5 | 2008-04-30 08:45:27 | [diff] [blame] | 70 | -------- |
| 71 | |
| 72 | linkgit:git-fsck[1], |
| 73 | linkgit:git-gc[1], |
| 74 | linkgit:git-reflog[1] |
| 75 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 76 | Author |
| 77 | ------ |
| 78 | Written by Linus Torvalds <torvalds@osdl.org> |
| 79 | |
| 80 | Documentation |
| 81 | -------------- |
| 82 | Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>. |
| 83 | |
| 84 | GIT |
| 85 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 86 | Part of the linkgit:git[1] suite |