I tested with Git 1.8.2 and SOCKS v5 proxy, following setting works for me:
git config --global http.proxy 'socks5://127.0.0.1:7070'
According to the document, despite the name
.proxy, it should work for both HTTP and HTTPS repository urls. Thanks @user for pointing out this.
To disable the proxy, run command:
git config --global --unset http.proxy
If you also want the host name to be resolved using the proxy, use thuzhf’s solution below, which uses
socks5h instead of
If you do not want to set the proxy as global config, try
$ ALL_PROXY=socks5://127.0.0.1:8888 git clone https://github.com/some/one.git