Git(GitHub) 004 配置代理 目的:clone提速

本文介绍如何为Git配置HTTP和HTTPS代理以加速代码拉取过程,包括正确的代理设置方法及常见错误做法的避免。

你如果没有翻墙,就算通过本篇博客对你的Git进行了配置,也是没有一点效果的。

在终端中执行:

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

查看一下:

$ git config --list

对于我现在使用的Windows 系统而言,输出是下面这个样子的。

core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager
filter.lfs.clean=git-lfs clean %f
filter.lfs.smudge=git-lfs smudge %f
filter.lfs.required=true
user.name=AoboJaing
user.email=744910955@qq.com
https.proxy=https://127.0.0.1:1080
http.proxy=http://127.0.0.1:1080

现在测试下载一个源代码试试看:(速度马上提上来)

Alt text

搞定


注意: 错误的做法:

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

参考网站:


请访问:http://www.aobosir.com/

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值