OSDN Git Service

Add Git official document to help
[tortoisegit/TortoiseGitJp.git] / doc / source / en / TortoiseGit / git_doc / git-prune.html.xml
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
3 \r
4 <article lang="en" id="git-prune(1)">\r
5 <articleinfo>\r
6     <title>git-prune(1)</title>\r
7         <indexterm>\r
8                 <primary>git-prune(1)</primary>\r
9         </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-prune - Prune all unreachable objects from the object database</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <simpara><emphasis>git-prune</emphasis> [-n] [-v] [--expire &lt;expire&gt;] [--] [&lt;head&gt;&#8230;]</simpara>\r
18 </simplesect>\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
27 In addition, it\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
32 </simplesect>\r
33 <simplesect id="_options">\r
34 <title>OPTIONS</title>\r
35 <variablelist>\r
36 <varlistentry>\r
37 <term>\r
38 -n\r
39 </term>\r
40 <listitem>\r
41 <simpara>\r
42         Do not remove anything; just report what it would\r
43         remove.\r
44 </simpara>\r
45 </listitem>\r
46 </varlistentry>\r
47 <varlistentry>\r
48 <term>\r
49 -v\r
50 </term>\r
51 <listitem>\r
52 <simpara>\r
53         Report all removed objects.\r
54 </simpara>\r
55 </listitem>\r
56 </varlistentry>\r
57 <varlistentry>\r
58 <term>\r
59 --\r
60 </term>\r
61 <listitem>\r
62 <simpara>\r
63         Do not interpret any more arguments as options.\r
64 </simpara>\r
65 </listitem>\r
66 </varlistentry>\r
67 <varlistentry>\r
68 <term>\r
69 --expire &lt;time&gt;\r
70 </term>\r
71 <listitem>\r
72 <simpara>\r
73         Only expire loose objects older than &lt;time&gt;.\r
74 </simpara>\r
75 </listitem>\r
76 </varlistentry>\r
77 <varlistentry>\r
78 <term>\r
79 &lt;head&gt;&#8230;\r
80 </term>\r
81 <listitem>\r
82 <simpara>\r
83         In addition to objects\r
84         reachable from any of our references, keep objects\r
85         reachable from listed &lt;head&gt;s.\r
86 </simpara>\r
87 </listitem>\r
88 </varlistentry>\r
89 </variablelist>\r
90 </simplesect>\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 &amp;&amp; $(git rev-parse --all))</literallayout>\r
97 </simplesect>\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
105 </simplesect>\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
111 </simplesect>\r
112 <simplesect id="_author">\r
113 <title>Author</title>\r
114 <simpara>Written by Linus Torvalds &lt;<ulink url="mailto:torvalds@osdl.org">torvalds@osdl.org</ulink>&gt;</simpara>\r
115 </simplesect>\r
116 <simplesect id="_documentation">\r
117 <title>Documentation</title>\r
118 <simpara>Documentation by David Greaves, Junio C Hamano and the git-list &lt;<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>&gt;.</simpara>\r
119 </simplesect>\r
120 <simplesect id="_git">\r
121 <title>GIT</title>\r
122 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>\r
123 </simplesect>\r
124 </article>\r