最全的git(clone或者push)时出现 "fatal: the remote end hung up unexpectedly index-package" 解决方案
使用idea clone git上项目,在用git操作项目clone或者push时报出异常:
the remote end hung up unexpectedly index-package
可能出现的原因以及解决方案如下。
方法一(git配置缓存问题):
修改提交缓存大小为500M,或者更大的数字
git config --global http.postBuffer 524288000
# some comments below report having to double the value:
git config --global http.postBuffer 1048576000
或者在克隆/创建版本库生成的 .git目录下面修改生成的config文件增加如下:
[http]
postBuffer = 524288000
修改如下:
然后重新推送。
方法二(网络比较缓慢情况下,链接断开了,配置git的最低速度和最低速度时间):
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999
单位 秒
--global配置对当前用户生效,如果需要对所有用户生效,则用--system
方法三(内网链接,访问访问国外Github 异常慢,尤其在clone远程代码的时候,几KiB/s的速度在遭遇几十上百M的代码后,让大家苦不堪言):
fatal: The remote end hung up unexpectedlyB | 2.00 KiB/s
我的是这样的,后面带| 2.00KiB/s
这句显示 远程结束挂起 |2KiB/s
1.获取Github相关网站的ip
访问https://www.ipaddress.com,找到页面中下方的“IP Address Tools – Quick Links”,
分别输入github.global.ssl.fastly.net和github.com,查询ip地址。
2.修改本地host文件
以windows为例,C:/WINDOWS/system32/drivers/etc/,打开host文件。
3.增加host映射
参考如下,增加github.global.ssl.fastly.net和github.com的映射。
151.101.185.194 http://global-ssl.fastly.Net
192.30.253.112 http://github.com
4.更新DNS缓存
命令行输入:ipconfig /flushdns。
5.大功告成
接下来就可以随意访问Github和clone代码了。
方法四(使用git clone时, fatal:index-pack failed,我碰见的就是这个问题):
该错误是因为当前clone文件夹的属性为“只读”,无法写入。
解决方案:将文件夹属性“只读”取消。
每天努力一点,每天都在进步。