1GIT-CLEAN(1) Git Manual GIT-CLEAN(1)
2
3
4
6 git-clean - Remove untracked files from the working tree
7
9 git clean [-d] [-f] [-n] [-q] [-e <pattern>] [-x | -X] [--] <path>...
10
11
13 Cleans the working tree by recursively removing files that are not
14 under version control, starting from the current directory.
15
16 Normally, only files unknown to git are removed, but if the -x option
17 is specified, ignored files are also removed. This can, for example, be
18 useful to remove all build products.
19
20 If any optional <path>... arguments are given, only those paths are
21 affected.
22
24 -d
25 Remove untracked directories in addition to untracked files. If an
26 untracked directory is managed by a different git repository, it is
27 not removed by default. Use -f option twice if you really want to
28 remove such a directory.
29
30 -f, --force
31 If the git configuration variable clean.requireForce is not set to
32 false, git clean will refuse to run unless given -f or -n.
33
34 -n, --dry-run
35 Don’t actually remove anything, just show what would be done.
36
37 -q, --quiet
38 Be quiet, only report errors, but not the files that are
39 successfully removed.
40
41 -e <pattern>, --exclude=<pattern>
42 Specify special exceptions to not be cleaned. Each <pattern> is the
43 same form as in $GIT_DIR/info/excludes and this option can be given
44 multiple times.
45
46 -x
47 Don’t use the ignore rules. This allows removing all untracked
48 files, including build products. This can be used (possibly in
49 conjunction with git reset) to create a pristine working directory
50 to test a clean build.
51
52 -X
53 Remove only files ignored by git. This may be useful to rebuild
54 everything from scratch, but keep manually created files.
55
57 Written by Pavel Roskin <proski@gnu.org[1]>
58
60 Part of the git(1) suite
61
63 1. proski@gnu.org
64 mailto:proski@gnu.org
65
66
67
68Git 1.7.4.4 04/11/2011 GIT-CLEAN(1)