现在的位置: 首页 > 综合 > 正文

[小技巧] git 清理 repository

2017年11月12日 ⁄ 综合 ⁄ 共 184字 ⁄ 字号 评论关闭

使用如下命令可以快速清除 repository 里没有被 git 管理的文件:

$ git clean -xdf

如果要保留某些后缀的文件,如 txt 文件,使用如下命令:

$ git clean -xdfe "*.txt"

参考:

http://stackoverflow.com/questions/16200359/git-clean-xdf-with-some-additional-filter

抱歉!评论已关闭.