Makefile: make script-related rules usable from subdirectories
[git.git] / Documentation / git-prune.txt
blob80d01b05710e250a5f1d548fca3fba54d50e0f29
1 git-prune(1)
2 ============
4 NAME
5 ----
6 git-prune - Prune all unreachable objects from the object database
9 SYNOPSIS
10 --------
11 [verse]
12 'git prune' [-n] [-v] [--expire <expire>] [--] [<head>...]
14 DESCRIPTION
15 -----------
17 NOTE: In most cases, users should run 'git gc', which calls
18 'git prune'. See the section "NOTES", below.
20 This runs 'git fsck --unreachable' using all the refs
21 available in `refs/`, optionally with additional set of
22 objects specified on the command line, and prunes all unpacked
23 objects unreachable from any of these head objects from the object database.
24 In addition, it
25 prunes the unpacked objects that are also found in packs by
26 running 'git prune-packed'.
28 Note that unreachable, packed objects will remain.  If this is
29 not desired, see linkgit:git-repack[1].
31 OPTIONS
32 -------
34 -n::
35 --dry-run::
36         Do not remove anything; just report what it would
37         remove.
39 -v::
40 --verbose::
41         Report all removed objects.
43 \--::
44         Do not interpret any more arguments as options.
46 --expire <time>::
47         Only expire loose objects older than <time>.
49 <head>...::
50         In addition to objects
51         reachable from any of our references, keep objects
52         reachable from listed <head>s.
54 EXAMPLE
55 -------
57 To prune objects not used by your repository nor another that
58 borrows from your repository via its
59 `.git/objects/info/alternates`:
61 ------------
62 $ git prune $(cd ../another && $(git rev-parse --all))
63 ------------
65 Notes
66 -----
68 In most cases, users will not need to call 'git prune' directly, but
69 should instead call 'git gc', which handles pruning along with
70 many other housekeeping tasks.
72 For a description of which objects are considered for pruning, see
73 'git fsck''s --unreachable option.
75 SEE ALSO
76 --------
78 linkgit:git-fsck[1],
79 linkgit:git-gc[1],
80 linkgit:git-reflog[1]
82 GIT
83 ---
84 Part of the linkgit:git[1] suite