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
4 <article lang="en" id="git-clean(1)">
\r
6 <title>git-clean(1)</title>
\r
8 <primary>git-clean(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-clean - Remove untracked files from the working tree</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
18 <literallayout><emphasis>git clean</emphasis> [-d] [-f] [-n] [-q] [-e <pattern>] [-x | -X] [--] <path>…</literallayout>
\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><path>...</emphasis> arguments are given, only those paths
\r
29 are affected.</simpara>
\r
31 <simplesect id="_options">
\r
32 <title>OPTIONS</title>
\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
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
70 Don't actually remove anything, just show what would be done.
\r
83 Be quiet, only report errors, but not the files that are
\r
84 successfully removed.
\r
93 --exclude=<pattern>
\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
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
124 Remove only files ignored by git. This may be useful to rebuild
\r
125 everything from scratch, but keep manually created files.
\r
131 <simplesect id="_git">
\r
133 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r