Git报错汇总

错误内容:
Error: Failed to connect to github.com port 443 after xxx ms: Timed out

  1. 查询自己的proxy

    1
    git config --global -l

    这个时候会显示你自己的proxy,例如:

    1
    2
    3
    4
    5
    //如果没有配置过,以下内容可能为空
    user.name=SteveJobs
    user.email=hello@world.com
    http.proxy=127.0.0.1:25565
    https.proxy=127.0.0.1:25565
  2. 删除自己的proxy设置

    1
    2
    git config --global --unset http.proxy
    git config --global --unset https.proxy
  3. 重新设置自己的proxy
    ipport修改成自己的端口号。

    1
    2
    git config --global http.proxy ip:port
    git config --global https.proxy ip:port
  4. 检查配置后的proxy

    1
    git config --global -l

结果:

1
2
3
4
user.name=SteveJobs
user.email=hello@world.com
http.proxy=127.0.0.1:7890
https.proxy=127.0.0.1:7890