The following command is for github.com only. You may also use gitee.com in China, so you can’t add proxies to all Git sites.

# agents set up git config - global http.https://github.com.proxy socks5: / / 127.0.0.1:1086 # to cancel the git config - global - the unset http.https://github.com.proxy

If there is no agent also don’t worry, there are special CDN acceleration:

git config --global url."https://ghproxy.com/https://github.com".insteadOf "https://github.com" 

Or:

git config --global url."https://hub.fastgit.org/".insteadOf "https://github.com/"

CDN accelerates the use of either option.

But because there is no official CDN, the above two are using love to generate electricity, may one day hang up.