delete untracked files with git clean
用于批量删除
branch
中新加的文件untracked files
git clean -nxdf
git checkout . && git clean -xdf
ps
## dryrun 检查哪些文件待删除
git clean -n
## 删除当前目录下没有被track过的文件和目录
git clean -df
## 删除当前目录下所有没有track过的文件,包含.gitignore文件里面的文件和目录
git clean -xf
Reference: https://git-scm.com/docs/git-clean
Disclaimer
- License under
CC BY-NC 4.0
- Copyright issue feedback
me#imzye.me
, replace # with @ - Not all the commands and scripts are tested in production environment, use at your own risk
- No privacy information is collected here