git filter-branch --force --index-filter "git rm --cached --ignore-unmatch -r 要删除的文件" --prune-empty --tag-name-filter cat -- --all # 遍历所有 commit,删除文件,重写历史 commit,项目顶层执行 git push origin --all --force # 强行远程推送