如何处理

首先,我们需要找出大文件。
找出排名前 3 的 pack 记录:

git verify-pack -v .git/objects/pack/pack-*.idx | sort -k 3 -g | tail -3
 
找出大文件所在的位置

git rev-list --objects --all | grep bd97bfde4d9a108d012dd1e4685ef8ad6e1ec0ea
 
处理大文件
git filter-branch --index-filter 'git rm --cached --ignore-unmatch  uploads/files/5d37a3de481b1.pdf'
 
执行以下语句
rm -rf .git/refs/original
git reflog expire --expire=now --all
git fsck --full --unreachable
git repack -A -d
git gc --aggressive --prune=now


需要提交就再执行
git push --force

更详细完整:
https://www.cnblogs.com/oloroso/p/13367120.html

git 文档说明:
https://www.atlassian.com/git/tutorials/using-branches

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐