1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
\r
4 <sect2 lang="en" id="git-clean(1)">
\r
5 <title>git-clean(1)</title>
\r
7 <primary>git-clean(1)</primary>
\r
9 <simplesect id="git-clean(1)__name">
\r
11 <simpara>git-clean - Remove untracked files from the working tree</simpara>
\r
13 <simplesect id="git-clean(1)__synopsis">
\r
14 <title>SYNOPSIS</title>
\r
16 <literallayout><emphasis>git clean</emphasis> [-d] [-f] [-n] [-q] [-e <pattern>] [-x | -X] [--] <path>…</literallayout>
\r
19 <simplesect id="git-clean(1)__description">
\r
20 <title>DESCRIPTION</title>
\r
21 <simpara>Cleans the working tree by recursively removing files that are not
\r
22 under version control, starting from the current directory.</simpara>
\r
23 <simpara>Normally, only files unknown to git are removed, but if the <emphasis>-x</emphasis>
\r
24 option is specified, ignored files are also removed. This can, for
\r
25 example, be useful to remove all build products.</simpara>
\r
26 <simpara>If any optional <emphasis><path>...</emphasis> arguments are given, only those paths
\r
27 are affected.</simpara>
\r
29 <simplesect id="git-clean(1)__options">
\r
30 <title>OPTIONS</title>
\r
38 Remove untracked directories in addition to untracked files.
\r
39 If an untracked directory is managed by a different git
\r
40 repository, it is not removed by default. Use -f option twice
\r
41 if you really want to remove such a directory.
\r
54 If the git configuration variable clean.requireForce is not set
\r
55 to false, <emphasis>git clean</emphasis> will refuse to run unless given -f or -n.
\r
68 Don't actually remove anything, just show what would be done.
\r
81 Be quiet, only report errors, but not the files that are
\r
82 successfully removed.
\r
91 --exclude=<pattern>
\r
95 In addition to those found in .gitignore (per directory) and
\r
96 $GIT_DIR/info/exclude, also consider these patterns to be in the
\r
97 set of the ignore rules in effect.
\r
107 Don't use the standard ignore rules read from .gitignore (per
\r
108 directory) and $GIT_DIR/info/exclude, but do still use the ignore
\r
109 rules given with <emphasis>-e</emphasis> options. This allows removing all untracked
\r
110 files, including build products. This can be used (possibly in
\r
111 conjunction with <emphasis>git reset</emphasis>) to create a pristine
\r
112 working directory to test a clean build.
\r
122 Remove only files ignored by git. This may be useful to rebuild
\r
123 everything from scratch, but keep manually created files.
\r
129 <simplesect id="git-clean(1)__see_also">
\r
130 <title>SEE ALSO</title>
\r
131 <simpara><xref linkend="gitignore(5)" /></simpara>
\r
133 <simplesect id="git-clean(1)__git">
\r
135 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r