git报错:curl 18 transfer closed with outstanding read data remaining

git报错:curl 18 transfer closed with outstanding read data remaining

error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

可能是tag资源太大引起的
可以尝试先浅拷贝,再fetch

git clone --depth=1 http://git地址
git fetch --unshallow

不知道你这个问题是否已经解决, 如果还没有解决的话:
  • 这篇博客也许可以解决你的问题👉 :git拉取失败:curl 18 transfer closed with outstanding read data remaining错的解决方案
  • 以下回答来自chatgpt:

    根据参考资料中的内容,可以尝试以下几种解决方案:

    1. 增加缓存区大小

    可以使用命令 git config --global http.postBuffer 2097152000 来增大缓存区,单位为字节。

    1. 使用浅克隆

    可以使用命令 git clone https://github.com/... --depth 1 来进行浅克隆,只克隆最近一次提交的文件,不包括整个历史版本。这样可以减少下载量。

    1. 切换协议

    将 http 协议换成 SSH 协议。将 https://github.com/... 改为 git://github.com/...

    如果以上三种解决方案均无效,可以尝试以下操作:

    1. 下载 zip 文件

    可以尝试下载该项目的 zip 文件,并在本地进行操作。也可以直接使用网页界面下载该项目的文件。

    1. 创建本地仓库并关联远程仓库

    创建本地仓库后,使用命令 git remote add origin [远程仓库地址] 将本地仓库与远程仓库建立对应关系。再将下载的项目添加到本地仓库中,提交到本地仓库并推送到远程仓库建立连接。

    注意:在推送到远程仓库前,可能需要先执行 git pull 命令,将本地和远程仓库同步。如果此时仍然出现报错,可以尝试切换网络。


如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^