• git clone 下载代码一直报error: RPC failed; curl 18 transfer closed with outstanding read data remaining fatal: the remote end hung up unexpectedly错误的解决思路


    1. 问题:git  clone  下载代码一直报错误

    Cloning into 'aplanmis-project'...
    remote: Enumerating objects: 176887, done.
    remote: Counting objects: 100% (176887/176887), done.
    remote: Compressing objects: 100% (75181/75181), done.
    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

     

    1. 解决思路
    • 把缓存区大小设置大点:根据项目的具体情况来设置缓冲区大小

    git config --global http.postBuffer 524288000     # 2GB
    git config --global http.postBuffer 2097152000        # 2GB
    git config --global http.postBuffer 3194304000       # 3GB

    •  执行上面命令如果依旧clone失败,考虑可能原因2:网络下载速度缓慢
    git config --global http.lowSpeedLimit 0
    git config --global http.lowSpeedTime 999999

    2.用http方式下载代码,发现可能依旧会存在该问题,用ssh方式来下载代码,下面是ssh公钥配置的说明

    • 码云提供了基于SSH协议的Git服务,在使用SSH协议访问仓库仓库之前,需要先配置好账户/仓库的SSH公钥。可以参考:https://gitee.com/help/articles/4181#article-header0官网配置

    生产ssh公钥:  ssh-keygen -t rsa -C "xxxxx@xxxxx.com"

    邮箱地址: xxxxx@xxxxx.com
    • 按照提示完成三次回车,即可生成 ssh key。通过查看 ~/.ssh/id_rsa.pub 文件内容,获取到你的 public key

    •  登录码云官网,点击个人LOGO,选择“设置”、“安全设置”、“ssh公钥”,添加生成的 public key 添加到仓库中。

    • 测试是否可以连接成功
    ssh -T git@gitee.com

     

    •  用ssh方式下载代码,发现可下载代码

    git  clone   git@gitee.com:......ssh地址




  • 相关阅读:
    oracle之 监听器无法启动的几个原因总结
    Hive之 数据类型
    Hive之 hive的三种使用方式(CLI、HWI、Thrift)
    Hive之 hive架构
    megajson 高性能的json序列化、反序列化工具
    golang json 处理的一些例子代码
    Golang把所有包括底层类库,输出到stderr的内容, 重新定向到一个日志文件里面?
    Golang的 signal
    OAuth 2.0
    golang产生guid
  • 原文地址:https://www.cnblogs.com/qianshouxiuluo/p/11778559.html
Copyright © 2020-2023  润新知