mac下访问github配置

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/lqlqlq007/article/details/81215225

最近gayhub被微软收购以后时不时会被墙掉:
这里写图片描述

代码pull或者push不成功,感觉糟透了。

还好,mac也可以像windows那样在hosts文件里手动配置gayhub域名对应的ip,只是hosts文件的路径和windows有所不同:

mac下hosts文件的路径是/private/etc/hosts

然后把下面这段ip-域名映射信息复制进去:

151.101.185.194 github.global.ssl.fastly.net
192.30.253.112 github.com
151.101.184.133 assets-cdn.github.com
151.101.184.133 avatars0.githubusercontent.com
151.101.112.133 avatars1.githubusercontent.com

复制后的hosts内容如下:
这里写图片描述

再试一下push:
这里写图片描述

嗯,速度快的飞起。

猜你喜欢

转载自blog.csdn.net/lqlqlq007/article/details/81215225