当前位置:   article > 正文

git报错:Failed to connect to github.com port 443 after 21061 ms: Couldn‘t connect to server_git failed to connect to localhost port 30000 afte

git failed to connect to localhost port 30000 after 2275 ms: couldn't connec

我在git push的时候遇到这个报错,

用以下方法解决:


在终端输入以下命令:

  1. git config --global http.proxy 代理IP地址:端口
  2. git config --global https.proxy 代理IP地址:端口

示例:

  1. git config --global http.proxy 127.0.0.1:7890
  2. git config --global https.proxy 127.0.0.1:7890

windows电脑,代理IP地址和端口 查看路径:
        网络和 Internet > 代理 > 手动设置代理 编辑

原理:

Git 发送请求给代理服务器,代理服务器代表 Git 连接到 GitHub 的 HTTPS 服务器,此时会用 443 端口进行安全连接,端口号 443 是 HTTPS 协议的默认端口号。我们需要配置好代理服务器,否则Git无法通过代理服务器去连接。更多内容去了解“代理服务器”、“正向代理”、“反向代理”。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/798600
推荐阅读
相关标签
  

闽ICP备14008679号