参考:https://gitee.com/help/articles/4232
在windows下,打开git bash(注意:用windows cmd是不行的):输入如下命令:
git filter-branch --tree-filter 'rm -f path/to/large/files' --tag-name-filter cat -- --all
git push origin --tags --force
git push origin --all --force
在ubuntu下,打开terminal,输入如下命令:
git filter-branch --tree-filter 'rm -f path/to/large/files' --tag-name-filter cat -- --all
git push origin master --tags --force
git push origin --all --force
Example
git filter-branch --tree-filter 'rm -f ./subs/file.pdf' --tag-name-filter cat -- --all