3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.41.0.337.g830b4a04c4
10 .TH "GIT\-PRUNE" "1" "2023\-07\-14" "Git 2\&.41\&.0\&.337\&.g830b4a" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-prune \- Prune all unreachable objects from the object database
35 \fIgit prune\fR [\-n] [\-v] [\-\-progress] [\-\-expire <time>] [\-\-] [<head>\&...]
44 .nr an-no-space-flag 1
52 In most cases, users should run \fIgit gc\fR, which calls \fIgit prune\fR\&. See the section "NOTES", below\&.
56 This runs \fIgit fsck \-\-unreachable\fR using all the refs available in \fBrefs/\fR, optionally with additional set of objects specified on the command line, and prunes all unpacked objects unreachable from any of these head objects from the object database\&. In addition, it prunes the unpacked objects that are also found in packs by running \fIgit prune\-packed\fR\&. It also removes entries from \&.git/shallow that are not reachable by any ref\&.
58 Note that unreachable, packed objects will remain\&. If this is not desired, see \fBgit-repack\fR(1)\&.
63 Do not remove anything; just report what it would remove\&.
68 Report all removed objects\&.
78 Only expire loose objects older than <time>\&.
83 Do not interpret any more arguments as options\&.
88 In addition to objects reachable from any of our references, keep objects reachable from listed <head>s\&.
92 To prune objects not used by your repository or another that borrows from your repository via its \fB\&.git/objects/info/alternates\fR:
98 $ git prune $(cd \&.\&./another && git rev\-parse \-\-all)
106 In most cases, users will not need to call \fIgit prune\fR directly, but should instead call \fIgit gc\fR, which handles pruning along with many other housekeeping tasks\&.
108 For a description of which objects are considered for pruning, see \fIgit fsck\fR\*(Aqs \-\-unreachable option\&.
111 \fBgit-fsck\fR(1), \fBgit-gc\fR(1), \fBgit-reflog\fR(1)
114 Part of the \fBgit\fR(1) suite