在我们使用github中的一些文件需要下载时,尤其是使用脚本的时候,希望使用wget可以拿取github中的单个文件,gihub有这个功能,需要访问raw.githubusercontent.com,但是当使用时,会出现如下这样的问题

Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 0.0.0.0, ::
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|0.0.0.0|:443... failed: Connection refused.
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|::|:443... failed: Connection refused.

解决方法

点击进入该网站,解析raw.githubusercontent.com的ip

如果是linux系统,则修改hosts文件,将ip对应域名加入即可,我这里查到的ip是185.199.109.133

$ sed -i '$a\185.199.109.133 raw.githubusercontent.com' /etc/hosts

如果是windows无法访问该页面,也可以添加,hosts路径为C:\Windows\System32\drivers\etc\hosts,与linux格式一样,然后就可以访问了

评论




正在载入...
PoweredHexo
HostedAliyun
DNSAliyun
ThemeVolantis
UV
PV
BY-NC-SA 4.0