【经验分享】git clone 时出现三种报错及解决方案
最近在使用 git 进行 git clone 时,经常报错,经过查询找到了一种解决方案,分享给大家。
一、第一种报错
执行git clone提示 “fatal: The remote end hung up unexpectedly”
[cos@VM-0-14-centos git_cos]$ git clone https://github.com/cos/Exercise.git
Cloning into 'Exercise'...
error: RPC failed; result=35, HTTP code = 0
fatal: The remote end hung up unexpectedly
二、第二种报错
执行git clone提示 “fatal: unable to access 目标地址: SSL connect error”
[cos@VM-0-14-centos git_cos]$ git clone https://github.com/cos/Exercise.git
Cloning into 'scripts'...
fatal: unable to access 'https://github.com/open-falcon/scripts.git/': SSL connect error
三、第三种报错
执行git clone提示 “fatal: unable to access 目标地址: Encountered end of file”
[cos@VM-0-14-centos linux]$ git clone https://github.com/cos/Exercise.git
Cloning into 'Exercise'...
fatal: unable to access 'https://github.com/cos/Exercise.git/': Encountered end of file
四、解决方案
将目标地址的 https 改为 git 即可。连不上 github 的原因太多了,防火墙、ip被屏蔽、国际线路不稳定等各种因素。