11

清除Git仓库未托管的文件

 3 years ago
source link: https://www.cnblogs.com/TianFang/p/13734297.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

需使用命令行clean git仓库的地方不多,就没有怎么记,在blog里面记录一下,下次好找。

# 删除 untracked files
git clean -f

# 连 untracked 的目录也一起删掉
git clean -fd

# 连 gitignore 的untrack 文件/目录也一起删掉 (慎用,一般这个是用来删掉编译出来的 .o之类的文件用的)
git clean -xfd

# 在用上述 git clean 前,强烈建议先加上 -n 参数来先看看会删掉哪些文件,防止重要文件被误删
git clean -nxfd
git clean -nf
git clean -nfd


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK