git-prune.1   [plain text]


'\" t
.\"     Title: git-prune
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\"      Date: 06/01/2011
.\"    Manual: Git Manual
.\"    Source: Git 1.7.5.4
.\"  Language: English
.\"
.TH "GIT\-PRUNE" "1" "06/01/2011" "Git 1\&.7\&.5\&.4" "Git Manual"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
git-prune \- Prune all unreachable objects from the object database
.SH "SYNOPSIS"
.sp
\fIgit prune\fR [\-n] [\-v] [\-\-expire <expire>] [\-\-] [<head>\&...]
.SH "DESCRIPTION"
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.sp
In most cases, users should run \fIgit gc\fR, which calls \fIgit prune\fR\&. See the section "NOTES", below\&.
.sp .5v
.RE
.sp
This runs \fIgit fsck \-\-unreachable\fR using all the refs available in refs/, 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\&.
.sp
Note that unreachable, packed objects will remain\&. If this is not desired, see \fBgit-repack\fR(1)\&.
.SH "OPTIONS"
.PP
\-n, \-\-dry\-run
.RS 4
Do not remove anything; just report what it would remove\&.
.RE
.PP
\-v, \-\-verbose
.RS 4
Report all removed objects\&.
.RE
.PP
\-\-
.RS 4
Do not interpret any more arguments as options\&.
.RE
.PP
\-\-expire <time>
.RS 4
Only expire loose objects older than <time>\&.
.RE
.PP
<head>\&...
.RS 4
In addition to objects reachable from any of our references, keep objects reachable from listed <head>s\&.
.RE
.SH "EXAMPLE"
.sp
To prune objects not used by your repository nor another that borrows from your repository via its \&.git/objects/info/alternates:
.sp
.if n \{\
.RS 4
.\}
.nf
$ git prune $(cd \&.\&./another && $(git rev\-parse \-\-all))
.fi
.if n \{\
.RE
.\}
.sp
.SH "NOTES"
.sp
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\&.
.sp
For a description of which objects are considered for pruning, see \fIgit fsck\fR\(aqs \-\-unreachable option\&.
.SH "SEE ALSO"
.sp
\fBgit-fsck\fR(1), \fBgit-gc\fR(1), \fBgit-reflog\fR(1)
.SH "GIT"
.sp
Part of the \fBgit\fR(1) suite