事情是这样的,三天前,老板说要聚餐,结果一开心,把白天学的资料一下子就朝仓库里放,
image-20200828203136807
remote: error: File: a8a79710125cc4f97598661f9ab44a8f735809f8 118.77 MB, exceeds
100.00 MB.
remote: Use command below to see the filename:
remote: git rev-list --objects --all | grep a8a79710125cc4f97598661f9ab44a8f7358
09f8
$ git rev-list --objects --all | grep a8a79710125cc4f97598661f9ab44a8f7358
a8a79710125cc4f97598661f9ab44a8f735809f8 GO/GoWeb资料.zip
查出来了原来是GO/GoWeb资料.zip这个文件大于100M了
当然,你也可以执行下列代码:,查出历史提交的最大文件。然后执行第三步
$ git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -5 | awk '{print$1}')"
git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatch GO/GoWeb资料.zip --prune-empty --tag-name-filter cat -- --all
出现这个错误
Cannot rewrite branches: You have unstaged changes
git stash
即可解决。以强制覆盖的方式推送你的repo, 命令如下:
git push origin master --force
虽然上面我们已经删除了文件, 但是我们的repo里面仍然保留了这些objects, 等待垃圾回收(GC), 所以我们要用命令彻底清除它, 并收回空间,命令如下:
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
彻底解决。
接下来正常提交提交即可,最后给大家再推荐一下gitee,用来保存东西,最合适不过了,就算不是学计算机的,照样可以得心应手,
最后安利一波日常使用命令
git