假设要删除var/log/system.log,我使用下面的命令解决了。
git filter-branch --index-filter 'git rm --cached --ignore-unmatch var/log/system.log' --tag-name-filter cat -- --all
Stackoverflow帖子上提到了几种策略,有重新修改,然后合并commit;也有使用另外的工具,不过上面的方案是我觉得最好的。
假设要删除var/log/system.log,我使用下面的命令解决了。
git filter-branch --index-filter 'git rm --cached --ignore-unmatch var/log/system.log' --tag-name-filter cat -- --all
Stackoverflow帖子上提到了几种策略,有重新修改,然后合并commit;也有使用另外的工具,不过上面的方案是我觉得最好的。