Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-prune(1) |
| 2 | ============ |
| 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | git-prune - Prunes all unreachable objects from the object database |
| 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | f65d928 | 2007-01-22 09:00:13 | [diff] [blame] | 11 | 'git-prune' [-n] [--] [<head>...] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 12 | |
| 13 | DESCRIPTION |
| 14 | ----------- |
| 15 | |
Junio C Hamano | 7ad22dc | 2007-01-29 02:55:48 | [diff] [blame] | 16 | This runs `git-fsck --unreachable` using all the refs |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 17 | available in `$GIT_DIR/refs`, optionally with additional set of |
| 18 | objects specified on the command line, and prunes all |
| 19 | objects unreachable from any of these head objects from the object database. |
| 20 | In addition, it |
| 21 | prunes the unpacked objects that are also found in packs by |
| 22 | running `git prune-packed`. |
| 23 | |
| 24 | OPTIONS |
| 25 | ------- |
| 26 | |
| 27 | -n:: |
| 28 | Do not remove anything; just report what it would |
| 29 | remove. |
| 30 | |
Junio C Hamano | 1bb569e | 2006-05-05 23:14:25 | [diff] [blame] | 31 | \--:: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 32 | Do not interpret any more arguments as options. |
| 33 | |
| 34 | <head>...:: |
| 35 | In addition to objects |
| 36 | reachable from any of our references, keep objects |
| 37 | reachable from listed <head>s. |
| 38 | |
| 39 | EXAMPLE |
| 40 | ------- |
| 41 | |
| 42 | To prune objects not used by your repository nor another that |
| 43 | borrows from your repository via its |
| 44 | `.git/objects/info/alternates`: |
| 45 | |
| 46 | ------------ |
| 47 | $ git prune $(cd ../another && $(git-rev-parse --all)) |
| 48 | ------------ |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 49 | |
| 50 | Author |
| 51 | ------ |
| 52 | Written by Linus Torvalds <torvalds@osdl.org> |
| 53 | |
| 54 | Documentation |
| 55 | -------------- |
| 56 | Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>. |
| 57 | |
| 58 | GIT |
| 59 | --- |
| 60 | Part of the gitlink:git[7] suite |
| 61 | |