error: RPC failed; curl 56 GnuTLS recv error (-9)

问题描述

下载Github仓库时出现如下错误

remote: Enumerating objects: 150, done.
remote: Counting objects: 100% (150/150), done.
remote: Compressing objects: 100% (90/90), done.
error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received.
fatal: The remote end hung up unexpectedly
fatal: 过早的文件结束符(EOF)
fatal: index-pack 失败

解析

参考git error: RPC failed; curl 56 GnuTLSGit 克隆错误‘RPC failed; curl 56 Recv failure....’ 及克隆速度慢问题解决,有可能是http缓存不够或者网络不稳定问题

  • 对于网络不稳定问题

Rebuilding git with openssl instead of gnutls fixed my problem.

  • 对于http缓存不够
# httpBuffer加大    
$ git config --global http.postBuffer 524288000

解决

重新设置了http缓存,不过最后是通过码云的方式解决的

  1. 先将Github仓库拉取到码云仓库
  2. 在从码云上下载