I tested with Git 1.8.2 and SOCKS v5 proxy, following setting works for me:

git config --global http.proxy 'socks5://127.0.0.1:7070'Code language: PHP (php)

UPDATE 2017-3-31:

According to the document, despite the name http.proxy, it should work for both HTTP and HTTPS repository urls. Thanks @user for pointing out this.

UPDATE 2018-11-27:

To disable the proxy, run command:

git config --global --unset http.proxyCode language: PHP (php)

EDIT 2019-03-04:

If you also want the host name to be resolved using the proxy, use thuzhf’s solution below, which uses socks5h instead of socks5

If you do not want to set the proxy as global config, try ALL_PROXY= e.g.:

$ ALL_PROXY=socks5://127.0.0.1:8888 git clone https://github.com/some/one.gitCode language: JavaScript (javascript)

分类: GIT

0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据