2

关于git拉取项目时,报RPC failed; curl 18 transfer closed with outstanding read d...

 7 months ago
source link: https://cloud.tencent.com/developer/article/1660797
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
社区首页 >专栏 >关于git拉取项目时,报RPC failed; curl 18 transfer closed with outstanding read data remaining错的解决方案

关于git拉取项目时,报RPC failed; curl 18 transfer closed with outstanding read data remaining错的解决方案

发布于 2020-07-14 02:16:31
18.1K1
文章被收录于专栏:跟着阿笨一起玩NET

之前在从git远程库拉取项目的时候,出现了如上错误,因为拉取时间过长才报的错,所以猜测是内存或者项目过大导致的无法拉取,所以搜了搜,网上说是解决方案有三种,一种是增大缓存区;二是浅克隆,也就是说克隆的时候,先少克隆一些,比如只克隆每个文件只取最近一次提交,不是整个历史版本,三是换协议:具体解决方案如下:

一,加大缓存区 git config --global http.postBuffer 524288000 这个大约是500M 二、少clone一些,–depth 1 git clone https://github.com/flutter/flutter.git --depth 1 –depth 1的含义是复制深度为1,就是每个文件只取最近一次提交,不是整个历史版本。 三、换协议 clone http方式换成SSH的方式,即 https:// 改为 git:// 例如git clone https://github.com/test/test.git 换成git clone git://github.com/test/test.git

记录一下今天在GitHub上拉取代码的报错及解决方法

原因可能有文件过大、网速太差、以及一些国外资源因为墙的因素影响等等

解决方式: 1、文件太大,解决方式为git添加 compression 配置项

git config --global core.compression -1 1 compression 是压缩的意思,从 clone 的终端输出就知道,服务器会压缩目标文件,然后传输到客户端,客户端再解压。取值为 [-1, 9],-1 以 zlib 为默认压缩库,0 表示不进行压缩,1…9 是压缩速度与最终获得文件大小的不同程度的权衡,数字越大,压缩越慢,当然得到的文件会越小

2、可以增加git的缓存大小

git config --global http.postBuffer 1048576000 (1G) 1 3、配置git的最低速和最低速时间

git config --global http.lowSpeedLimit 0 git config --global http.lowSpeedTime 999999 单位 秒 1 2 global配置对当前用户生效,如果需要对所有用户生效,则用–system

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-07-12 ,如有侵权请联系 [email protected] 删除

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK