.git文件夹过大的解决方法

改自:Git删除历史记录中的大文件

git verify-pack -v .git/objects/pack/pack-*.idx | sort -k 3 -g | tail -5
1753e0b6aa1cd3ed27d1d14e8e569664c685e896 blob   44600 43841 37970
ca12c545eae19d688ac840c7f0e2e623a1a4192b blob   45262 8534 140448
7a3265ee94c0ab25cf079ac8ccdf87f41d455d42 blob   54708 49093 171307
72590cee1315e32dada25535184dcee97c6f5af9 blob   1114323 1104823 113887612
4cc1f9dcef1004355d2a595d45808e99f100dc4d blob   114592569 113703558 184054
git rev-list --objects --all | grep 4cc1f9dcef1004355d2a595d45808e99f100dc4d
4cc1f9dcef1004355d2a595d45808e99f100dc4d books/Android.pdf
git log --pretty=oneline --branches -- books/Android.pdf
git filter-branch --index-filter 'git rm --cached --ignore-unmatch books/Android.pdf' -- --all
rm -Rf .git/refs/original
rm -Rf .git/logs/
git gc
git prune
git push --force
posted @ 2020-12-30 22:15  doNotTellU  阅读(1050)  评论(0编辑  收藏  举报