问题描述
所以,GitHub现已被俄罗斯政府和Rospotrebnadzor正式禁止。我使用GitHub创建免费软件并共享它,这是我生命中重要的一部分。今天我在Arch Linux上安装了Tor,现在我可以浏览GitHub和其他被禁止的网站。我试图让 git
通过Tor工作,但没有成功。
这是我做的:
git config --global http.proxy localhost:9050
git config --global https.proxy localhost:9050
但是当我尝试推送时,出现错误 501
:
因此, 501
表示'未实施'。我对Tor没有什么经验(但从现在起我开始欣赏它),所以不知道是否真的不可能这样使用Tor或者我做错了什么。
问:如何配置 git
以通过Tor使用它?
设置HTTP或HTTPS代理不起作用,因为Tor作为SOCKS代理在端口9050上运行。相反,软件 socat
在你的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
住在〜/ .ssh / config
中。上面的配置告诉主机 github
的SSH设置。它接受你的输入并通过 socat
通过Tor指引它。
现在你可以做一个 git COMMAND ssh:// github / USER / REPO
和git会通过Tor完成你的 COMMAND
。
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
:
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?
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.
这篇关于如何使git工作,通过tor推送提交到GitHub?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!