Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:

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.

Today I've installed Tor on Arch Linux and now I'm able to browse GitHub and other banned sites. I tried to make git work via Tor but without success.

Here is what I did:

git config --global http.proxy localhost:9050
git config --global https.proxy localhost:9050

But when I try to push, I get error 501:

fatal: unable to access 'https://X@github.com/X/X.git/': Received HTTP code 501 from proxy after CONNECT

So, 501 means 'not implemented'. I have little experience with Tor (but from now on I'm starting to appreciate it), so don't know if it's really impossible to use Tor this way or I'm doing something wrong.

Q: how to configure git to use it via Tor?

share|improve this question
    
Related: stackoverflow.com/questions/10274879/… – raina77ow Dec 3 '14 at 18:56
    
Also related: stackoverflow.com/questions/783811/… And, as CQM suggested in the post linked by raina, it might be easier to just set up a VM whose only internet connection is through Tor. It might work without needing to proxy then. – Eric Palace Dec 3 '14 at 20:06
    
For web browsing Hola plugin for chrome is a simpler and faster solution then tor. chrome.google.com/webstore/detail/hola-better-internet/… – xvorsx Dec 13 '14 at 2:59
    
@xvorsx, well, Tor also gives you privacy if you follow some rules. As far as I know Google Chrome is proprietary software. How can you believe you have privacy when you use proprietary software? I don't use Google Chrome because it would be the only software on my system that is not free (in terms of license). – Mark Dec 14 '14 at 12:52

4 Answers 4

up vote 8 down vote accepted
+50

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.

share|improve this answer

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.
share|improve this answer
    
Thanks for your answer, I will do exactly that if there are no less complicated solutions. – Mark Dec 6 '14 at 9:50

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!

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.