
最近克隆github项目时老是报超时,可以尝试以下解决方法 如果本地开启了代理还是clone超时,可以尝试最后一种方式解决
1、把 https 换成 http,如:
git clone http:xxx2、更新本地hosts配置,可以参考这篇文章获取最新的hosts
C:\Windows\System32\drivers\etc\hostsipconfig /flushdns3、 将通信协议由 http/2 改为 http/1.1
git config --global http.version HTTP/1.14、如果本地开启了代理也还是报超时,可以把git代理地址设置下,使用如下命令,其中 127.0.0.1 是代理URL,1080是端口
git config --global http.proxy 127.0.0.1:1080git config --global http.proxy git config --global --unset http.proxy
git config --global --unset https.proxyWindows路径:C:\Users\Administrator\.gitconfig
Linux路径: ~/.gitconfig[http]
version = HTTP/1.1
proxy = 127.0.0.1:1080原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。