<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<article lang="en" id="git-clean(1)">
<articleinfo>
    <title>git-clean(1)</title>
        <indexterm>
                <primary>git-clean(1)</primary>
        </indexterm>
</articleinfo>
<simplesect id="_name">
<title>NAME</title>
<simpara>git-clean - Remove untracked files from the working tree</simpara>
</simplesect>
<simplesect id="_synopsis">
<title>SYNOPSIS</title>
<blockquote>
<literallayout><emphasis>git clean</emphasis> [-d] [-f] [-n] [-q] [-x | -X] [--] &lt;path&gt;&#8230;</literallayout>
</blockquote>
</simplesect>
<simplesect id="_description">
<title>DESCRIPTION</title>
<simpara>Removes files unknown to git.  This allows to clean the working tree
from files that are not under version control.  If the <emphasis>-x</emphasis> option is
specified, ignored files are also removed, allowing to remove all
build products.
If any optional <literal>&lt;path&gt;&#8230;</literal> arguments are given, only those paths
are affected.</simpara>
</simplesect>
<simplesect id="_options">
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term>
-d
</term>
<listitem>
<simpara>
        Remove untracked directories in addition to untracked files.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-f
</term>
<listitem>
<simpara>
        If the git configuration specifies clean.requireForce as true,
        <emphasis>git-clean</emphasis> will refuse to run unless given -f or -n.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-n
</term>
<term>
--dry-run
</term>
<listitem>
<simpara>
        Don&#8217;t actually remove anything, just show what would be done.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-q
</term>
<term>
--quiet
</term>
<listitem>
<simpara>
        Be quiet, only report errors, but not the files that are
        successfully removed.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-x
</term>
<listitem>
<simpara>
        Don&#8217;t use the ignore rules.  This allows removing all untracked
        files, including build products.  This can be used (possibly in
        conjunction with <emphasis>git-reset</emphasis>) to create a pristine
        working directory to test a clean build.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-X
</term>
<listitem>
<simpara>
        Remove only files ignored by git.  This may be useful to rebuild
        everything from scratch, but keep manually created files.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="_author">
<title>Author</title>
<simpara>Written by Pavel Roskin &lt;<ulink url="mailto:proski@gnu.org">proski@gnu.org</ulink>&gt;</simpara>
</simplesect>
<simplesect id="_git">
<title>GIT</title>
<simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
</simplesect>
</article>
