https://zhangxiaofan.blog.csdn.net/article/details/83899911
https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/removing-sensitive-data-from-a-repository
要将 PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA
这个路径 替换成你要删除的文件的路径
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA" \
--prune-empty --tag-name-filter cat -- --all
然后
git add .
git commit -am "submit "
#这里注意 如果是master的话可能会是protected的,要解除master分支的保护,然后再push
git push origin --force --all