updated git doc
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-clean.xml
blobae9d35e836c06b6123feffaebdcf891b6aed5be3
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">\r
3 \r
4 <article lang="en" id="git-clean(1)">\r
5 <articleinfo>\r
6     <title>git-clean(1)</title>\r
7 <indexterm>\r
8 <primary>git-clean(1)</primary>\r
9 </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-clean - Remove untracked files from the working tree</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <blockquote>\r
18 <literallayout><emphasis>git clean</emphasis> [-d] [-f] [-n] [-q] [-e &lt;pattern&gt;] [-x | -X] [--] &lt;path&gt;&#8230;</literallayout>\r
19 </blockquote>\r
20 </simplesect>\r
21 <simplesect id="_description">\r
22 <title>DESCRIPTION</title>\r
23 <simpara>Cleans the working tree by recursively removing files that are not\r
24 under version control, starting from the current directory.</simpara>\r
25 <simpara>Normally, only files unknown to git are removed, but if the <emphasis>-x</emphasis>\r
26 option is specified, ignored files are also removed. This can, for\r
27 example, be useful to remove all build products.</simpara>\r
28 <simpara>If any optional <emphasis>&lt;path&gt;...</emphasis> arguments are given, only those paths\r
29 are affected.</simpara>\r
30 </simplesect>\r
31 <simplesect id="_options">\r
32 <title>OPTIONS</title>\r
33 <variablelist>\r
34 <varlistentry>\r
35 <term>\r
36 -d\r
37 </term>\r
38 <listitem>\r
39 <simpara>\r
40         Remove untracked directories in addition to untracked files.\r
41         If an untracked directory is managed by a different git\r
42         repository, it is not removed by default.  Use -f option twice\r
43         if you really want to remove such a directory.\r
44 </simpara>\r
45 </listitem>\r
46 </varlistentry>\r
47 <varlistentry>\r
48 <term>\r
49 -f\r
50 </term>\r
51 <term>\r
52 --force\r
53 </term>\r
54 <listitem>\r
55 <simpara>\r
56         If the git configuration variable clean.requireForce is not set\r
57         to false, <emphasis>git clean</emphasis> will refuse to run unless given -f or -n.\r
58 </simpara>\r
59 </listitem>\r
60 </varlistentry>\r
61 <varlistentry>\r
62 <term>\r
63 -n\r
64 </term>\r
65 <term>\r
66 --dry-run\r
67 </term>\r
68 <listitem>\r
69 <simpara>\r
70         Don't actually remove anything, just show what would be done.\r
71 </simpara>\r
72 </listitem>\r
73 </varlistentry>\r
74 <varlistentry>\r
75 <term>\r
76 -q\r
77 </term>\r
78 <term>\r
79 --quiet\r
80 </term>\r
81 <listitem>\r
82 <simpara>\r
83         Be quiet, only report errors, but not the files that are\r
84         successfully removed.\r
85 </simpara>\r
86 </listitem>\r
87 </varlistentry>\r
88 <varlistentry>\r
89 <term>\r
90 -e &lt;pattern&gt;\r
91 </term>\r
92 <term>\r
93 --exclude=&lt;pattern&gt;\r
94 </term>\r
95 <listitem>\r
96 <simpara>\r
97         In addition to those found in .gitignore (per directory) and\r
98         $GIT_DIR/info/exclude, also consider these patterns to be in the\r
99         set of the ignore rules in effect.\r
100 </simpara>\r
101 </listitem>\r
102 </varlistentry>\r
103 <varlistentry>\r
104 <term>\r
105 -x\r
106 </term>\r
107 <listitem>\r
108 <simpara>\r
109         Don't use the standard ignore rules read from .gitignore (per\r
110         directory) and $GIT_DIR/info/exclude, but do still use the ignore\r
111         rules given with <emphasis>-e</emphasis> options.  This allows removing all untracked\r
112         files, including build products.  This can be used (possibly in\r
113         conjunction with <emphasis>git reset</emphasis>) to create a pristine\r
114         working directory to test a clean build.\r
115 </simpara>\r
116 </listitem>\r
117 </varlistentry>\r
118 <varlistentry>\r
119 <term>\r
120 -X\r
121 </term>\r
122 <listitem>\r
123 <simpara>\r
124         Remove only files ignored by git.  This may be useful to rebuild\r
125         everything from scratch, but keep manually created files.\r
126 </simpara>\r
127 </listitem>\r
128 </varlistentry>\r
129 </variablelist>\r
130 </simplesect>\r
131 <simplesect id="_git">\r
132 <title>GIT</title>\r
133 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
134 </simplesect>\r
135 </article>\r