Configure Git Proxy With Socks5

To configure Git to use a SOCKS proxy, you use the http.proxy and https.proxy configuration options. Here is how you can do it:

  1. Open Terminal.
  2. Type in the following command to set the HTTP proxy:
git config --global http.proxy 'socks5://127.0.0.1:1080'

In this command, 127.0.0.1 is the local IP address and 1080 is the port number. Replace these with your SOCKS proxy’s IP address and port number.

  1. Type in the following command to set the HTTPS proxy:
git config --global https.proxy 'socks5://127.0.0.1:1080'

Again, replace 127.0.0.1 and 1080 with your SOCKS proxy’s IP address and port number.

  1. You can check your configuration changes by typing:
git config --global --get http.proxy
git config --global --get https.proxy

These commands should return the SOCKS proxy settings that you just entered.

  1. If you want to unset or remove the proxy settings, you can do so by typing:
git config --global --unset http.proxy
git config --global --unset https.proxy

Leave a Reply

Your email address will not be published. Required fields are marked *