眾所周知GitHub服務(wù)器的連通性都不太好,于是我們可以指定ip,達到穩(wěn)定的效果。
非常簡單,只需要:修改/etc/hosts文件,加上GitHub網(wǎng)站的IP地址就可以。
步驟1、打開host文件
sudo vi /etc/hosts
步驟2、加入ip地址
# GitHub Start 192.30.253.112 github.com 192.30.253.119 gist.github.com 199.232.28.133 assets-cdn.github.com 199.232.28.133 raw.githubusercontent.com 199.232.28.133 gist.githubusercontent.com 199.232.28.133 cloud.githubusercontent.com 199.232.28.133 camo.githubusercontent.com 199.232.28.133 avatars0.githubusercontent.com 199.232.28.133 avatars1.githubusercontent.com 199.232.28.133 avatars2.githubusercontent.com 199.232.28.133 avatars3.githubusercontent.com 199.232.28.133 avatars4.githubusercontent.com 199.232.28.133 avatars5.githubusercontent.com 199.232.28.133 avatars6.githubusercontent.com 199.232.28.133 avatars7.githubusercontent.com 199.232.28.133 avatars8.githubusercontent.com 185.199.110.154 github.githubassets.com # GitHub End
然后就OK了,看看是否能正常連接GitHub。
補充
這是最新找的一份Github ip地址。文章來源:http://www.zghlxwxcb.cn/article/595.html
如果ip失效了,可以在去【githubusercontent.com.ipaddress.com/raw.githubusercontent.com】,找到ip替換即可。文章來源地址http://www.zghlxwxcb.cn/article/595.html
到此這篇關(guān)于解決Linux訪問不了GitHub問題只需要配置host,Linux無法訪問github解決方案的文章就介紹到這了,更多相關(guān)內(nèi)容可以在右上角搜索或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!