GitClone报错问题解决

在配置vim插件的过程中准备克隆github仓库到本地,但是出现 errno=Connection timed out 的报错,现在尝试处理。

问题描述

执行命令如下

git clone git://github.com/jiangmiao/auto-pairs.git ~/.vim/bundle/auto-pairs

详细报错如下

fatal: unable to connect to github.com:
github.com[0: 20.205.243.166]: errno=Connection timed out

发现这是因为使用了git://**导致的错误,更深的原因并不清楚,这里发现只要改用https就可以解决问题。

问题解决

执行以下代码

git config --global url.https://github.com/.insteadOf git://github.com/
git config --global url."https://".insteadOf git://

这些命令将向**.gitconfig**的配置文件下写入替代git://为https:// 的规则。

同理也可以直接向配置文件写入对应的规则。