当前位置:   article > 正文

git clone访问超时问题解决_克隆github显示无法访问连接超时

克隆github显示无法访问连接超时

问题:

我们在使用git clone克隆github上的项目的时候,可能经常会遇到下面这样的提示

git clone https://github.com/xxx
Cloning into 'xxx'...
fatal: unable to access 'https://github.com/xxx/': Failed to connect to github.com port 443: Timed out
  • 1
  • 2
  • 3

说的就是连接443端口失败,失败原因是超时。443端口就是HTTPS的网页浏览端口,说明git访问这个网页超时,但是我们其实挂梯子其实可以成功访问github.com的。

这个主要就是因为我们用了代理服务器来加速访问github,但是git clone没有配置代理导致的连接超时

解决方法

配置git的代理

git config --global http.proxy "127.0.0.1:端口号"  

git config --global https.proxy "127.0.0.1:端口号"
  • 1
  • 2
  • 3

注意其中的端口号需要更换你自身使用的代理的端口号

配置好之后使用httpshttp的方式重新git clone就可以啦

$ git clone https://github.com/xxx
  • 1

在这里插入图片描述

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号