Using a socks proxy with git for the http transport

前端 未结 7 1925
臣服心动
臣服心动 2020-11-28 00:48

How to make git use a socks proxy for HTTP transport?

I succeed in configuring git with GIT_PROXY_COMMAND to use a socks proxy for GIT transport.

Also, I hav

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-28 01:16

    None of the suggested methods worked for me, so I found another approach as the following instruction:


    1. Make a tunnel (dynamic port forwarding) over SOCKS5 protocol using ssh:
      ssh -ND 9994 user@YourSshServer

    1. Install proxychains on your localhost, not the ssh server you're connected to:
    • Using apt-get:
      sudo apt-get install proxychains
    • Using its GitHub repository:
      Check Installation section on its readme file.
      How to set socks5 proxy on firefox

    1. Edit your proxychains configure file:
      sudo nano /etc/proxychains.conf then add the following line at the end of file:
      socks5 127.0.0.1 9994

    1. Now we are ready to do a git command (proxychains must be placed before the command):
      proxychains git push origin develop

提交回复
热议问题