# 问题

git clone 远程仓库,端口 443 报错

Failed to connect to github.com port 443 after ms: Timed out

# 分析

因为使用代理软件,例如 Clash,导致 Git 端口配置与系统代理不一致

# 解决

  1. 打开 设置 -> 网络和Internet -> 代理 -> 使用代理服务器(编辑)
  2. 记录当前系统代理 IP 和端口,例如 127.0.0.1:7890
  3. 终端执行以下命令修改 Git 网络配置
git config --global http.proxy http://127.0.0.1:7890 
git config --global https.proxy http://127.0.0.1:7890
  1. 终端执行以下命令取消、查看代理
# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 查看代理
git config --global --get http.proxy
git config --global --get https.proxy
更新于