1GIT-PRUNE(1)                      Git Manual                      GIT-PRUNE(1)
2
3
4

NAME

6       git-prune - Prune all unreachable objects from the object database
7

SYNOPSIS

9       git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]
10
11

DESCRIPTION

13           Note
14           In most cases, users should run git gc, which calls git prune. See
15           the section "NOTES", below.
16
17       This runs git fsck --unreachable using all the refs available in refs/,
18       optionally with additional set of objects specified on the command
19       line, and prunes all unpacked objects unreachable from any of these
20       head objects from the object database. In addition, it prunes the
21       unpacked objects that are also found in packs by running git
22       prune-packed. It also removes entries from .git/shallow that are not
23       reachable by any ref.
24
25       Note that unreachable, packed objects will remain. If this is not
26       desired, see git-repack(1).
27

OPTIONS

29       -n, --dry-run
30           Do not remove anything; just report what it would remove.
31
32       -v, --verbose
33           Report all removed objects.
34
35       --progress
36           Show progress.
37
38       --expire <time>
39           Only expire loose objects older than <time>.
40
41       --
42           Do not interpret any more arguments as options.
43
44       <head>...
45           In addition to objects reachable from any of our references, keep
46           objects reachable from listed <head>s.
47

EXAMPLES

49       To prune objects not used by your repository or another that borrows
50       from your repository via its .git/objects/info/alternates:
51
52           $ git prune $(cd ../another && git rev-parse --all)
53
54

NOTES

56       In most cases, users will not need to call git prune directly, but
57       should instead call git gc, which handles pruning along with many other
58       housekeeping tasks.
59
60       For a description of which objects are considered for pruning, see git
61       fsck's --unreachable option.
62

SEE ALSO

64       git-fsck(1), git-gc(1), git-reflog(1)
65

GIT

67       Part of the git(1) suite
68
69
70
71Git 2.18.1                        05/14/2019                      GIT-PRUNE(1)
Impressum