使用github遇到的问题及其解决方法汇总

一、解决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.orggit.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工具

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值