Git使用代理提交Github

使用git或者Pycharm向github提交代码,经常会出现以下两种异常:

配置代理可解决问题。

  • 连接超时
    Failed to connect to github.com port 443 after 21097 ms: Couldn't connect to server
    
  • 无法访问
    fatal: unable to access 'https://github.com/ByteToy/algo/': Failure when receiving data from the peer
    

Pycharm配置代理

Pycharm中配置代理,基本上不起作用,仅作配置演示 File-->Settings-->Appearance&Behavior-->System Settings-->HTTP Proxy-->Manual proxy configuration

bytetoy.cn

Git配置代理

直接在终端下进行配置,pycharm也会调用此代理配置

  • 配置代理

    git config --global http.proxy 127.0.0.1:7890
    git config --global https.proxy 127.0.0.1:7890
    
  • 查看配置

    git config --global --list
    user.name=ByteToy
    user.email=12620716@qq.com
    safe.directory=D:/bench
    http.proxy=127.0.0.1:7890
    https.proxy=127.0.0.1:7890
    
  • 取消代理配置

    如果后面不需要代理,或者代理服务器不可用了,可以取消代理配置

git config --gobal unset http.proxy
git config --gobal unset https.proxy

results matching ""

    No results matching ""

    results matching ""

      No results matching ""