1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
\r
4 <article lang="en" id="git-prune(1)">
\r
6 <title>git-prune(1)</title>
\r
8 <primary>git-prune(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-prune - Prune all unreachable objects from the object database</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
17 <simpara><emphasis>git-prune</emphasis> [-n] [-v] [--expire <expire>] [--] [<head>…]</simpara>
\r
19 <simplesect id="_description">
\r
20 <title>DESCRIPTION</title>
\r
21 <note><simpara>In most cases, users should run <emphasis>git-gc</emphasis>, which calls
\r
22 <emphasis>git-prune</emphasis>. See the section "NOTES", below.</simpara></note>
\r
23 <simpara>This runs <emphasis>git-fsck --unreachable</emphasis> using all the refs
\r
24 available in <literal>$GIT_DIR/refs</literal>, optionally with additional set of
\r
25 objects specified on the command line, and prunes all unpacked
\r
26 objects unreachable from any of these head objects from the object database.
\r
28 prunes the unpacked objects that are also found in packs by
\r
29 running <emphasis>git-prune-packed</emphasis>.</simpara>
\r
30 <simpara>Note that unreachable, packed objects will remain. If this is
\r
31 not desired, see <xref linkend="git-repack(1)"/>.</simpara>
\r
33 <simplesect id="_options">
\r
34 <title>OPTIONS</title>
\r
42 Do not remove anything; just report what it would
\r
53 Report all removed objects.
\r
63 Do not interpret any more arguments as options.
\r
69 --expire <time>
\r
73 Only expire loose objects older than <time>.
\r
83 In addition to objects
\r
84 reachable from any of our references, keep objects
\r
85 reachable from listed <head>s.
\r
91 <simplesect id="_example">
\r
92 <title>EXAMPLE</title>
\r
93 <simpara>To prune objects not used by your repository nor another that
\r
94 borrows from your repository via its
\r
95 <literal>.git/objects/info/alternates</literal>:</simpara>
\r
96 <literallayout>$ git prune $(cd ../another && $(git rev-parse --all))</literallayout>
\r
98 <simplesect id="_notes">
\r
99 <title>Notes</title>
\r
100 <simpara>In most cases, users will not need to call <emphasis>git-prune</emphasis> directly, but
\r
101 should instead call <emphasis>git-gc</emphasis>, which handles pruning along with
\r
102 many other housekeeping tasks.</simpara>
\r
103 <simpara>For a description of which objects are considered for pruning, see
\r
104 <emphasis>git-fsck</emphasis>'s --unreachable option.</simpara>
\r
106 <simplesect id="_see_also">
\r
107 <title>SEE ALSO</title>
\r
108 <simpara><xref linkend="git-fsck(1)"/>,
\r
109 <xref linkend="git-gc(1)"/>,
\r
110 <xref linkend="git-reflog(1)"/></simpara>
\r
112 <simplesect id="_author">
\r
113 <title>Author</title>
\r
114 <simpara>Written by Linus Torvalds <<ulink url="mailto:torvalds@osdl.org">torvalds@osdl.org</ulink>></simpara>
\r
116 <simplesect id="_documentation">
\r
117 <title>Documentation</title>
\r
118 <simpara>Documentation by David Greaves, Junio C Hamano and the git-list <<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>>.</simpara>
\r
120 <simplesect id="_git">
\r
122 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
\r