blob: 60e38e6e275f5cf90a1ccba36dd3930cafa1b630 [file] [log] [blame]
Junio C Hamano60d00632006-04-05 10:34:431git-clean(1)
2============
3
4NAME
5----
6git-clean - Remove untracked files from the working tree
7
8SYNOPSIS
9--------
10[verse]
Junio C Hamano619596a2010-08-18 22:15:3511'git clean' [-d] [-f] [-n] [-q] [-e <pattern>] [-x | -X] [--] <path>...
Junio C Hamano60d00632006-04-05 10:34:4312
13DESCRIPTION
14-----------
Junio C Hamanoe91ea772009-04-26 01:41:4115
Junio C Hamanobde411d2009-05-07 05:07:3116Cleans the working tree by recursively removing files that are not
17under version control, starting from the current directory.
Junio C Hamanoe91ea772009-04-26 01:41:4118
19Normally, only files unknown to git are removed, but if the '-x'
20option is specified, ignored files are also removed. This can, for
21example, be useful to remove all build products.
22
Junio C Hamano9e395072008-07-31 22:11:2123If any optional `<path>...` arguments are given, only those paths
24are affected.
Junio C Hamano26a57372006-05-10 00:13:4025
Junio C Hamano60d00632006-04-05 10:34:4326OPTIONS
27-------
28-d::
29Remove untracked directories in addition to untracked files.
Junio C Hamanoac34f562009-08-16 19:04:0530If an untracked directory is managed by a different git
31repository, it is not removed by default. Use -f option twice
32if you really want to remove such a directory.
Junio C Hamano60d00632006-04-05 10:34:4333
Junio C Hamano47b9acd2007-04-24 07:34:3434-f::
Junio C Hamano68cfa3a2009-08-30 00:22:5535--force::
Junio C Hamanod3304322010-02-05 03:28:2736If the git configuration variable clean.requireForce is not set
37to false, 'git clean' will refuse to run unless given -f or -n.
Junio C Hamano47b9acd2007-04-24 07:34:3438
Junio C Hamano60d00632006-04-05 10:34:4339-n::
Junio C Hamanoeb415992008-06-08 22:49:4740--dry-run::
Junio C Hamano60d00632006-04-05 10:34:4341Don't actually remove anything, just show what would be done.
42
43-q::
Junio C Hamanoeb415992008-06-08 22:49:4744--quiet::
Junio C Hamano60d00632006-04-05 10:34:4345Be quiet, only report errors, but not the files that are
46successfully removed.
47
Junio C Hamano619596a2010-08-18 22:15:3548-e <pattern>::
49--exclude=<pattern>::
50Specify special exceptions to not be cleaned. Each <pattern> is
51the same form as in $GIT_DIR/info/excludes and this option can be
52given multiple times.
53
Junio C Hamano60d00632006-04-05 10:34:4354-x::
55Don't use the ignore rules. This allows removing all untracked
56files, including build products. This can be used (possibly in
Junio C Hamano1aa40d22010-01-21 17:46:4357conjunction with 'git reset') to create a pristine
Junio C Hamano60d00632006-04-05 10:34:4358working directory to test a clean build.
59
60-X::
61Remove only files ignored by git. This may be useful to rebuild
62everything from scratch, but keep manually created files.
63
64
65Author
66------
67Written by Pavel Roskin <proski@gnu.org>
68
69
70GIT
71---
Junio C Hamanof7c042d2008-06-06 22:50:5372Part of the linkgit:git[1] suite