码迷,mamicode.com
首页 > 其他好文 > 详细

核弹级的git指令 git filter-branch

时间:2017-07-06 20:49:34      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:dex   word   留空   widget   abs   log   filter   scm   模块   

 

 比如一不小心把node模块目录加入git仓库了,导致仓库很大 :

 

git filter-branch --index-filter git rm --cached --ignore-unmatch -fr ./node_modules -- --all

  

如果不保留空的提交,可以这样:

 

git filter-branch -f --prune-empty --index-filter git rm --cached --ignore-unmatch -fr ./image -- --all 

 

 

还有批量修改邮件地址等操作,参考这里: https://git-scm.com/docs/git-filter-branch

 
 

核弹级的git指令 git filter-branch

标签:dex   word   留空   widget   abs   log   filter   scm   模块   

原文地址:http://www.cnblogs.com/fwindpeak/p/7127689.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!