Git remove new untracked files
This question already has an answer here:
For your case, you could give an exclude parameter:
git clean -nd -e **/.gitignore
However, normally, I think it would be recommended to do either of these instead:
.gitignore
file. If the ignore rules are useful for everyone who uses the repo, then it makes sense to push it to the remote. git clean
will not remove committed files. .git/info/exclude
file instead of a .gitignore
file. (This is a recommendation from gitignore documentation) 使用-f参数:
git clean -f
链接地址: http://www.djcxy.com/p/3268.html
下一篇: Git删除新的未跟踪文件