3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
7 .\" Source: Git 2.47.0.rc1.33.g90fe3800b9
10 .TH "GIT\-PRUNE" "1" "2024-10-04" "Git 2\&.47\&.0\&.rc1\&.33\&.g9" "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>\&...\:]
43 .nr an-no-space-flag 1
51 In most cases, users should run \fIgit gc\fR, which calls \fIgit prune\fR\&. See the section "NOTES", below\&.
55 This runs \fIgit fsck \-\-unreachable\fR using all the refs available in \fBrefs/\fR, optionally with an 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\&.
57 Note that unreachable, packed objects will remain\&. If this is not desired, see \fBgit-repack\fR(1)\&.
62 Do not remove anything; just report what it would remove\&.
67 Report all removed objects\&.
77 Only expire loose objects older than <time>\&.
82 Do not interpret any more arguments as options\&.
87 In addition to objects reachable from any of our references, keep objects reachable from listed <head>s\&.
91 To prune objects not used by your repository or another that borrows from your repository via its \fB\&.git/objects/info/alternates\fR:
97 $ git prune $(cd \&.\&./another && git rev\-parse \-\-all)
104 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\&.
106 For a description of which objects are considered for pruning, see \fIgit fsck\fR\*(Aqs \-\-unreachable option\&.
109 \fBgit-fsck\fR(1), \fBgit-gc\fR(1), \fBgit-reflog\fR(1)
112 Part of the \fBgit\fR(1) suite