温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Git设置和取消代理的方法

发布时间:2020-09-26 01:03:38 来源:脚本之家 阅读:334 作者:isea533 栏目:编程语言

参考: https://gist.github.com/laispace/666dd7b27e9116faece6

前提是你本地有 socks5 代理。

上面参考地址作者提供的配置无效,但是后面回复中的配置有效:

git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'

还有针对 github.com 的单独配置:

#只对github.com
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
#取消代理
git config --global --unset http.https://github.com.proxy)

直接使用 socks5 的速度很快,近百兆的项目能在短时间内下载完。

测试:

$ git clone https://github.com/abel533/mybatis-3.git
Cloning into 'mybatis-3'...
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 209581 (delta 0), reused 12 (delta 0), pack-reused 209561
Receiving objects: 100% (209581/209581), 72.32 MiB | 405.00 KiB/s, done.
Resolving deltas: 100% (176933/176933), done.

速度在 405.00 KiB/s,已经很快了。

曾经为此写过的一个小应用可以关闭了。

Git设置和取消代理的方法

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对亿速云的支持。如果你想了解更多相关内容请查看下面相关链接

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI