git删除文件及提交历史
钢翼
编程
1.更新本地代码到最新
2.删除文件及历史
删除文件
git filter-branch --force --index-filter "git rm --cached --
ignore-unmatch 文件相对路径" --prune-empty --tag-name-filter cat -- --all
删除文件夹
git filter-branch --force --index-filter "git rm -r --cached --
ignore-unmatch 文件夹相对路径" --prune-empty --tag-name-filter cat -- --all
注:使用双引号而不是单引号
3.提交到远程
git push --all --force