如何在Git上配置socks5代理 [英] How to config socks5 proxy on Git
问题描述
通过Linux OS上的代理下载git start链接(git://anongit.freedesktop.org/wayland/wayland)时遇到问题。
我使用的是Git客户端( http:// git-scm.com/download/linux )下载它,并且在配置 .gitconfig
文件。
但我已经尝试了很多方法来为git链接配置socks5代理,但它没有奏效。有没有人知道这一点?
有关详情:
-
我需要使用带有1080端口的socks5代理。
-
此socks5代理的用户名和密码
patthoyts 在使用socks代理和git进行http传输最终会让它在Git 2.7中上游( 2015年12月)
请参阅 commit 6d7afe0 (2015年10月26日)作者: Pat Thoyts( patthoyts
) 。
(由 Jeff King - peff
- 在 commit 92b9bf4 ,2015年12月1日)。
$ b
remote-http
(s):支持SOCKS代理
通过这个补丁,我们可以正确支持SOCKS代理,像
这样:
git config http.proxy socks5://192.168。 67.1:32767
如果没有这个补丁,Git会错误地尝试使用SOCKS代理就好像他们的
是HTTP代理一样,导致出现如下错误消息:
致命的:无法访问'http://.../':Proxy CONNECT中止
这个补丁需要在有问题的AP后面工作,并从
中获取使用sit代理和git http运输,并用
保留由Johannes Schindelin进行的适当cURL版本检查。
I have problem with downloading the git start link (git://anongit.freedesktop.org/wayland/wayland) through a proxy on Linux OS.
I am using Git client (http://git-scm.com/download/linux) to download it, and it is successful to download the http link after I config the http.proxy in the .gitconfig
file.
But I have tried a lot of ways to config the socks5 proxy for git link, but it didn't work. Does anyone know this?
More info on this:
I need to use a socks5 proxy with 1080 port.
There are username and password for this socks5 proxy
The patch mentioned by patthoyts in "Using a socks proxy with git for the http transport" will finally make it upstream in Git 2.7 (Dec. 2015)
See commit 6d7afe0 (26 Oct 2015) by Pat Thoyts (patthoyts
).
(Merged by Jeff King -- peff
-- in commit 92b9bf4, 01 Dec 2015).
remote-http
(s): support SOCKS proxiesWith this patch we properly support SOCKS proxies, configured e.g. like this:
git config http.proxy socks5://192.168.67.1:32767
Without this patch, Git mistakenly tries to use SOCKS proxies as if they were HTTP proxies, resulting in a error message like:
fatal: unable to access 'http://.../': Proxy CONNECT aborted
This patch was required to work behind a faulty AP and scraped from Using a socks proxy with git for the http transport and guarded with an appropriate cURL version check by Johannes Schindelin.
这篇关于如何在Git上配置socks5代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!