Simply put
To set, view, and cancel the proxy configuration in Git, you can use the following commands:
- To set the proxy configuration:
git config --global http.proxy http://proxy.example.com:8080
git config --global https.proxy https://proxy.example.com:8080
# sock5代理
git config --global http.proxy socks5 127.0.0.1:7891
git config --global http.proxy socks5 127.0.0.1:7891
Replace “proxy.example.com:8080” with your proxy server and port.
- To view the current proxy configuration:
git config --global --get http.proxy
git config --global --get https.proxy
- To cancel the proxy configuration:
git config --global --unset http.proxy
git config --global --unset https.proxy