github拉代码出现:error: RPC failed; curl 18 transfer closed with outstanding read data remaining xxx。
在拉取github上https://github.com/noties/Markwon,通过https协议拉取。
1 背景
在拉取github上https://github.com/noties/Markwon,通过https协议拉取
git clone https://github.com/noties/Markwon
本地出现如下异常:
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
error: 8180 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
2 问题分析
上述问题基本上是因为源代码文件比较大,比如有几十M或者更大。加上网络比较慢等。
3 解决方案
<1> 先查看本地git全局配置
git config --global --list
以下是本地的配置截图:
如果如果没有配置git缓冲http.postbuffeer,可针对的进行设置。
<2> 设置git global 缓冲
git config --global http.postBuffer 524288000
这个大约是500M。本人本地设置了大概5000M。
通过上述配置后,如果仍出现上述问题。则尝试使用ssh协议拉取。
<3> 新建ssh key
进入路径C:\Users\Administrator,命令行输入如下命令,执行生成你的sshkey
ssh-keygen -t rsa -C "这里换上你的邮箱"
回车后会询问你ssh key生成的路径、是否需要密码,不需要的话直接留空回车即可。
生成成功后,该路径下会出现如下文件
id_rsa.pub文件就是对应的公钥,打开之后可以看到是一个无序的字符串。
<4> GitHub关联ssh
进入GitHub的个人设置,找到【SSH and GPG keys】,然后点击新增SSH,进入如下界面,title输入你对于当前SSH key的备注,下面的key就粘贴上一步生成的id_rsa.pub内的内容。
<5> 使用ssh协议拉取代码
如果网速比较慢的话,需要下载相当长时间,耐心等待即可。
4 参考文章
1 git clone error:RPC failed; curl 18 transfer closed with outstanding read data remaining
2 github使用ssh方式
更多推荐
所有评论(0)