当前位置:   article > 正文

remote: Please remove the file from history and try again.

please remove the file from history and try again

问题

git commit 之后才发现忘了把一个很大的jar包删掉,git push错误提示如下:

remote: error: File: 35eb36918ab68c6433d5b3eae55a53b6bc5f7a5a 851.36 MB, exceeds 100.00 MB.
remote: Use command below to see the filename:
remote: git rev-list --objects --all | grep 35eb36918ab68c6433d5b3eae55a53b6bc5f7a5a
remote: Please remove the file from history and try again. (https://gitee.com/help/articles/4232)
  • 1
  • 2
  • 3
  • 4

解决

1、按提示找出文件名,以下命令一定要在git命令窗口进行

$ git rev-list --objects --all | grep 35eb36918ab68c6433d5b3eae55a53b6bc5f7a5a
3afd05f7bcf48117d75d848dcc04f9e9a0caeca5 docker/ruoyi/modules/ams/jar/ams.jar
  • 1
  • 2

找出文件名 docker/ruoyi/modules/ams/jar/ams.jar

2、在git中去除此文件

$ git filter-branch --force --index-filter  "git rm --cached --ignore-unmatch docker/ruoyi/modules/ams/jar/ams.jar" --prune-empty --tag-name-filter cat -- --all
  • 1

操作完成后,需要重新add提交一下文件

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

闽ICP备14008679号