最近克隆github项目时老是报超时,可以尝试以下解决方法
如果本地开启了代理还是clone超时,可以尝试最后一种方式解决
1、把 https 换成 http,如:
git clone http:xxx
2、更新本地hosts配置,可以参考这篇文章获取最新的hosts
C:\Windows\System32\drivers\etc\hosts
ipconfig /flushdns
解决github图片及网页加载不出来
3、 将通信协议由 http/2 改为 http/1.1文章来源:https://www.toymoban.com/news/detail-804853.html
git config --global http.version HTTP/1.1
- 改回来:
git config --global http.version HTTP/2
4、如果本地开启了代理也还是报超时,可以把git代理地址设置下,使用如下命令,其中 127.0.0.1 是代理URL,1080是端口文章来源地址https://www.toymoban.com/news/detail-804853.html
git config --global http.proxy 127.0.0.1:1080
- 查询是否使用代理:
git config --global http.proxy
- 取消代理设置:
git config --global --unset http.proxy
git config --global --unset https.proxy
- 或者在配置文件中修改代理:
Windows路径:C:\Users\Administrator\.gitconfig
Linux路径: ~/.gitconfig
[http]
version = HTTP/1.1
proxy = 127.0.0.1:1080
到了这里,关于github clone Failed to connect to github.com port 443 after xxx ms的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!