How to make git work to push commits to GitHub via tor?

后端 未结 5 1566
走了就别回头了
走了就别回头了 2020-12-14 17:22

So, GitHub is now officially banned by Russian Government and Rospotrebnadzor. I used GitHub to create free software and share it, and it\'s important part of my life.

相关标签:
5条回答
  • 2020-12-14 17:44

    You used a wrong syntax, correct is:

    git config http.proxy socks5://localhost:9150 # 9150 for TOR browser, 9050 for TOR service git config https.proxy socks5://localhost:9150

    0 讨论(0)
  • 2020-12-14 17:48

    Take a look at Tails OS and PIA. Both of these should keep you safe and free.

    0 讨论(0)
  • 2020-12-14 17:57

    You could switch from httpsto sshand use the tor SOCKS proxy in this way:

    export SOCKS_SERVER=localhost:9050
    git clone ssh://github.com/user/repo
    

    Note that you need credentials when using ssh!

    0 讨论(0)
  • 2020-12-14 18:01

    It might be easier to install a VM as suggested, like Whonix (also on GitHub), which will:

    • take care of the Tor connection
    • allow you to use Git with GitHub without having to define any proxy.
    0 讨论(0)
  • 2020-12-14 18:08

    Setting an HTTP or HTTPS proxy will not work, because Tor acts on port 9050 as a SOCKS proxy. What will work instead is the software socat with some settings inside your SSH config:

    Host github
      HostName github.com
      IdentityFile /path/to/your/file
      User git
      ProxyCommand socat STDIO SOCKS4A:127.0.0.1:%h:%p,socksport=9050
    

    Your SSH settings usually live in ~/.ssh/config. The configurations above tell SSH settings for the host github. It takes your input and directs it via socat through Tor.

    Now you can do a git COMMAND ssh://github/USER/REPO and git will do your COMMAND via Tor.

    0 讨论(0)
提交回复
热议问题