需求:较大的文件重复提交后,为节省git空间,想将其在历史提交记录中删除;
通过git-filter-branch实现;
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch path-to-your-remove-file' --prune-empty --tag-name-filter cat -- --all
需求:较大的文件重复提交后,为节省git空间,想将其在历史提交记录中删除;
通过git-filter-branch实现;
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch path-to-your-remove-file' --prune-empty --tag-name-filter cat -- --all