Git Git 小贴士:清除所有被 Ignore 的文件

jsuper · March 17, 2014 · 7581 hits

1. 查看所有被 Git 忽略的文件

Git 1.6+:
git ls-files --others -i --exclude-standard

#Git 1.4, 1.5:
git ls-files --others -i \
--exclude-from="`git rev-parse --git-dir`/info/exclude" \
--exclude-per-directory=.gitignore

2. 清除所有被 Git 忽略的文件或文件夹 (小心)

2.1 查看在清理之前会做的操作

git clean -Xn

2.2 清除文件或文件夹, -f 选项强制删除,-d 删除目录(小心)

git clean -Xdf
No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.