当前位置: 首页 > 科技观察

妙法:一劳永逸解决各种Github错误

时间:2023-03-17 22:36:39 科技观察

1.提问由于众所周知的原因,我们在从github上下载资源库时,总会遇到各种错误。例如:Connectingtoraw.githubConnectingtoraw.githubusercontent.comFailed:Refusedtoconnecttoubusercontent.comFailed:Refusedtoconnect又如:Failedtoconnecttoraw.githubusercontent.comport443:Connectionrefused2.尝试解决问题我们可能尝试了多种方法解决但最终无济于事,比如修改hosts:或者修改DNS。然后在某些特殊情况下此解决方案无济于事。3、再次尝试解决问题我们尝试“科学上网”解决问题,设置git的代理。gitconfig--globalhttps.proxyhttp://127.0.0.1:1080gitconfig--globalhttps.proxy'socks5://127.0.0.1:1080'但是,代理经常被禁止。4.一劳永逸的解决方案不再是一个坎,一劳永逸的解决方案就是使用某宝的镜像:gitconfig--globalurl.https://github.com.cnpmjs.org/.insteadofhttps://github.com/这样设置之后,就不用担心github报错了。