一、解决github上无法显示图片的问题
不知道什么时候开始,GitHub
里面的图片无法加载出来了。经分析发现GitHub
里面图片都在githubusercontent.com
域名下,我们只需要在hosts
里绑定域名和对应的IP,hosts
文件内容如下:
52.74.223.119 github.com
52.74.223.119 gist.github.com
54.169.195.247 api.github.com
185.199.111.153 assets-cdn.github.com
199.232.96.133 raw.githubusercontent.com
199.232.96.133 gist.githubusercontent.com
199.232.96.133 cloud.githubusercontent.com
199.232.96.133 camo.githubusercontent.com
199.232.96.133 avatars.githubusercontent.com
199.232.96.133 avatars0.githubusercontent.com
199.232.96.133 avatars1.githubusercontent.com
199.232.96.133 avatars2.githubusercontent.com
199.232.96.133 avatars3.githubusercontent.com
199.232.96.133 avatars4.githubusercontent.com
199.232.96.133 avatars5.githubusercontent.com
199.232.96.133 avatars6.githubusercontent.com
199.232.96.133 avatars7.githubusercontent.com
199.232.96.133 avatars8.githubusercontent.com
199.232.96.133 user-images.githubusercontent.com
185.199.109.154 github.githubassets.com
注:Windows的hosts文件位置:C:/windows/system32/drivers/etc/hosts 。
二、解决github clone速度慢问题
从github clone一些项目的时候速度极慢,经常clone到一半失败。这时可以使用国内镜像网站来替代。
方法一:
使用码云gitee.com的【从github导入已有项目】,然后git clone【码云】中的项目。
方法二:
目前已知Github国内镜像网站有github.com.cnpmjs.org和git.sdut.me。可以选择其中一个相对较快的来使用。在clone某个项目的时候将github.com替换为github.com.cnpmjs.org即可。如下例:
git clone https://github.com/kubernetes/kubernetes.git
替换为
git clone https://github.com.cnpmjs.org/kubernetes/kubernetes.git
或者
git clone https://git.sdut.me/kubernetes/kubernetes.git
镜像站点
更多国内镜像站参考:http://openpilot.sdut.me/mirror.html
三、查找IP工具