Git Proxy


This is, sadly, one of those China-only dev problems:

“Failed to connect to github.com port 443:connection timed out”

We can solve this by setting up local or global proxy for git:

local:

1
2
git config http.proxy http://127.0.0.1:10809
git config https.proxy http://127.0.0.1:10809

global:

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

and unset respectively:

1
2
git config --unset http.proxy 
git config --unset https.proxy 

global:

1
2
git config --global --unset http.proxy 
git config --global --unset https.proxy 

Updated for github’s new authenticating policy: From August 13, 2021, Github is no longer accepting password for git operations authenticating. You need to add Personal Access Token instead. The new authenticating method caused me troubles:

fatal: unable to access ‘https://github.com///': HTTP/2 stream 3 was not closed cleanly before end of the underlying stream

I had it temporary fixed by forcing git to use http version 1.1:

1
git config --global http.version HTTP/1.1