]> git.ipfire.org Git - thirdparty/git.git/blob - Documentation/git-prune.txt
Merge branch 'maint'
[thirdparty/git.git] / Documentation / git-prune.txt
1 git-prune(1)
2 ============
3
4 NAME
5 ----
6 git-prune - Prune all unreachable objects from the object database
7
8
9 SYNOPSIS
10 --------
11 'git-prune' [-n] [--expire <expire>] [--] [<head>...]
12
13 DESCRIPTION
14 -----------
15
16 This runs `git-fsck --unreachable` using all the refs
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
31 \--::
32 Do not interpret any more arguments as options.
33
34 \--expire <time>::
35 Only expire loose objects older than <time>.
36
37 <head>...::
38 In addition to objects
39 reachable from any of our references, keep objects
40 reachable from listed <head>s.
41
42 EXAMPLE
43 -------
44
45 To prune objects not used by your repository nor another that
46 borrows from your repository via its
47 `.git/objects/info/alternates`:
48
49 ------------
50 $ git prune $(cd ../another && $(git-rev-parse --all))
51 ------------
52
53 Author
54 ------
55 Written by Linus Torvalds <torvalds@osdl.org>
56
57 Documentation
58 --------------
59 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
60
61 GIT
62 ---
63 Part of the gitlink:git[7] suite