问题描述:github.com 在 阿里云ESC服务器上 ping 不通
解决方法: 1、访问 www.ipaddress.com/ 地址获取 github.com 的 IP 地址
往下找到如图所示的IP
PING一下能 Ping 通。
2、更改 hosts
将记录添加进服务器/etc/hosts
,如:echo "140.xx.xx.4 github.com" >> /etc/hosts
3、使用 git 代理,将下面的 xxx.xxx.xxx.xxx 换成你找到的 github IP地址 git config --global http.proxy xxx.xxx.xxx.xxx:10808 git config --global https.proxy xxx.xxx.xxx.xxx:10808
在拉github项目就可以拉下来了。
如果有更优的方法,欢迎交流探讨,共同进步!