当前位置:   article > 正文

Git提交大文件报错“remote: Please remove the file from history and try again. ”

please remove the file from history and try again.

如在使用Git过程中不小心将较大的二进制文件加入仓库,那么仓库大小很快就会超过规定的配额,在Push的时候会报下面的错误:

remote: Powered by GITEE.COM [GNK-6.4]
remote: error: File: c91e5de4f55bedd0669db01036fc131ea8e516ce 130.66 MB, exceeds 100.00 MB.
remote: Use command below to see the filename:
remote: git rev-list --objects --all | grep c91e5de4f55bedd0669db01036fc131ea8e516ce
remote: Please remove the file from history and try again. (https://gitee.com/help/articles/4232)

 解决方案:

按照提示输入命令查看存储库中的大文件

git rev-list --objects --all | grep c91e5de4f55bedd0669db01036fc131ea8e516ce

改写历史,去除大文件

  1. git filter-branch --tree-filter 'rm -f path/to/large/files' --tag-name-filter cat -- --all
  2. git push origin --tags --force
  3. git push origin --all --force

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/正经夜光杯/article/detail/806644
推荐阅读
相关标签
  

闽ICP备14008679号