Github上git clone失败:Failed to connect to github.com port 443: Connection timed out

  • 问题:
    从github上git clone失败:Failed to connect to github.com port 443: Connection timed out

  • 解决办法:
    网页上使用VPN可以打开github,说明在拉取代码时没有使用VPN进行代理。使用客户端的VPN,设置服务器使用客户端的VPN。

# 设置代理
git config --global http.proxy x.x.x.x:7890
git config --global https.proxy x.x.x.x:7890

# 查看代理
git config --global --get http.proxy
git config --global --get https.proxy

# 下载
git clone --recurse-submodules https://github.com/cvg/DeepLSD.git

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy

参考资料
Git报错: Failed to connect to github.com port 443 解决方案

  • 10
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在遇到"Failed to connect to github.com port 443 after xxx ms: Timed out"错误时,可能是由于网络连接问题导致的。以下是一些可能的解决办法: 1. 检查网络连接:确保你的网络连接正常,可以尝试访问其他网站来确认网络是否正常工作。 2. 检查防火墙设置:如果你使用防火墙,请确保允许git通过防火墙进行网络连接。你可以尝试禁用防火墙或者添加git到防火墙的白名单中。 3. 检查代理设置:如果你使用代理服务器进行网络连接,请确保你的git配置正确地指向了代理服务器。你可以使用以下命令检查和修改git的代理设置: ```shell # 查看当前代理设置 git config --global --get http.proxy git config --global --get https.proxy # 设置代理 git config --global http.proxy http://proxy.example.com:8888 git config --global https.proxy https://proxy.example.com:8888 # 取消代理设置 git config --global --unset http.proxy git config --global --unset https.proxy ``` 4. 尝试使用SSH协议:如果你使用的是HTTPS协议进行git操作,可以尝试使用SSH协议来连接github。首先,你需要生成SSH密钥并将公钥添加到你的github账户中。然后,你可以使用SSH URL来进行git操作,例如: ```shell git clone git@github.com:username/repo.git ``` 5. 尝试更改git的配置:有时候,更改git的一些配置选项也可以解决连接超时的问题。你可以尝试执行以下命令来更改git的配置: ```shell # 设置git的超时时间为60秒 git config --global http.lowSpeedLimit 60 git config --global http.lowSpeedTime 60 ``` 请注意,以上解决办法仅供参考,具体的解决方法可能因个人情况而异。如果问题仍然存在,请尝试联系网络管理员或者咨询github的支持团队以获取更多帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值