抱歉,您的浏览器无法访问本站
本页面需要浏览器支持(启用)JavaScript
了解详情 >

介绍

clean从工作树中删除未跟踪的文件

1
git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] [<pathspec>...]

参数解析

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-d        Normally, when no <pathspec> is specified, git clean will not recurse into untracked directories to avoid removing too much. Specify -d to have it recurse into such directories as well. If a <pathspec> is specified, -d is
irrelevant; all untracked files matching the specified paths (with exceptions for nested git directories mentioned under --force) will be removed.

-f, --force 强制删除文件

-i, --interactive 显示所有删除的文件(交互模式)

-n, --dry-run 不去删除文件,只显示会删除的文件

-q, --quiet 静默模式

-e <pattern>, --exclude=<pattern> 正则表达式进行排除文件
Use the given exclude pattern in addition to the standard ignore rules (see gitignore(5)).

-x 不使用gitignore中的忽略模式,只使用-e指定的模式排除文件

评论