当我们克隆github上的项目时,有时因为DNS的问题,基本上克隆不了,一直卡在Clone into 'go'...,如下图所示:
jagitch@34c4dd4d4a3e:opensource$ git clone https://github.com/golang/go.git
Cloning into 'go'...
解决方法:
-
查询github.com的ip地址,如下图所示,github.com的ip为对
20.205.243.166
-
将上一步查询到的github.com的IP配置到/etc/hosts文件中,如果是Windows系统,则修改C:\Windows\System32\drivers\etc\hosts文件
127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 172.18.0.2 34c4dd4d4a3e 20.205.243.166 github.com - <

最低0.47元/天 解锁文章
9662

被折叠的 条评论
为什么被折叠?



