git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -3
git rev-list --objects --all | grep 343940a
git log --pretty=oneline --branches -- _src/归档.zip
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch _src/归档.zip' --prune-empty --tag-name-filter cat -- --all
rm -Rf .git/refs/original
rm -Rf .git/logs/
git reflog --all
git prune
git gc
du -hs
git count-objects -v
删除敏感文件:
# 假设要删除的文件是password.txt,运行如下命令:
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch src/main/resources/passowrd.txt' HEAD
git filter-branch --force --index-filter 'git rm -r --cached --ignore-unmatch src/main/resources/passowrd.txt' HEAD
# 如果commit已经同步到了github,那么再运行如下命令永久删除远端上的文件。
git push --all --force
参考:
https://help.github.com/articles/removing-sensitive-data-from-a-repository/
https://blog.csdn.net/meteor1113/article/details/4407209
https://help.github.com/articles/removing-sensitive-data-from-a-repository/
https://blog.csdn.net/zcf1002797280/article/details/50723783
修改时间 2019-01-14
声明:本站所有文章和图片,如无特殊说明,均为原创发布。商业转载请联系作者获得授权,非商业转载请注明出处。