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://[email protected]/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?
At the top of your repository on GitHub.com's Quick Setup page, click to copy the remote repository URL. In the Command prompt, add the URL for the remote repository where your local repository will be pushed. Push the changes in your local repository to GitHub.com.
To push the commit from the local repo to your remote repositories, run git push -u remote-name branch-name where remote-name is the nickname the local repo uses for the remote repositories and branch-name is the name of the branch to push to the repository. You only have to use the -u option the first time you push.
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.
It might be easier to install a VM as suggested, like Whonix (also on GitHub), which will:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With