blob: a81cb6c28050e83778f11f2957d3489f50fa6004 [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 Hamano9e395072008-07-31 22:11:2111'git clean' [-d] [-f] [-n] [-q] [-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
48-x::
49Don't use the ignore rules. This allows removing all untracked
50files, including build products. This can be used (possibly in
Junio C Hamano1aa40d22010-01-21 17:46:4351conjunction with 'git reset') to create a pristine
Junio C Hamano60d00632006-04-05 10:34:4352working directory to test a clean build.
53
54-X::
55Remove only files ignored by git. This may be useful to rebuild
56everything from scratch, but keep manually created files.
57
58
59Author
60------
61Written by Pavel Roskin <proski@gnu.org>
62
63
64GIT
65---
Junio C Hamanof7c042d2008-06-06 22:50:5366Part of the linkgit:git[1] suite