git远程克隆仓库报错`fatal: The remote end hung up unexpectedly`

文章目录


git远程克隆仓库报错 fatal: The remote end hung up unexpectedly

所以在此记录一下解决方案,主要是网速太慢的原因。

思路

  • 找到对应域名的ip地址,然后在hosts文件加上ip–>域名的映射,刷新DNS缓存便可

实施

  • 在网站 https://www.ipaddress.com/ 分别搜索
github.global.ssl.fastly.net
github.com

得到ip:

image-20210519193538291

image-20210519193622721

编辑hosts文件

vim /etc/hosts

添加如下内容

199.232.69.194 github.global.ssl.fastly.net
140.82.112.3 github.com

保存更新DNS,安装nscd

yum install -y nscd

刷新这个守护进程

service nscd restart

但是克隆远程仓库又报错:fatal: Out of memory, malloc Failed (tried to allocate 1048576000 bytes)

还是网络慢的原因,所以需要设置git配置参数,否则因此超时退出

git参数配置

cgit参数配置如下:

git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999
git config --global http.postBuffer 5242880

完成,试试git clone这条命令速度如何?


相关文章

developer-roadmap —— 提供最全的开发者技术路线指南。前端...
一个极简的文件分享工具,无需注册且没有广告即可生成共享下...
收集 Github、Gitee优秀的开源项目,并进行归类整理。项目地...
大家好,我是 Java陈序员,我们有时会搭建一个属于自己的网站...
一个提供交互式的Web UI用于生成兼容MyBatisPlus框架的相关功...
大家好,我是 Java 陈序员。权限认证是我们日常开发绕不过的...