如何使用git设置HTTP代理?

最新资讯发布日期:2021-02-22

image.png

Git是一个免费的、开源的本控制软件。在Windows上安装git,一般为msysgit。 但是在安装的时候一定要注意下,在Windows Explorer integration选项中将“Git Bash here”和“Git GUI here”打对勾。下面来详细介绍使用git设置HTTP代理方法。

1、如果公司使用代理,git就需要设置代理才能克隆远程仓库

执行下面两条语句

git config --global http.proxy 10.167.32.133:8080
git config --global https.proxy 10.167.32.133:8080

2、如果需要用户名和密码

git config –global http.proxy http://user:password@10.167.32.133:8080
git config –global http.proxy https://user:password@10.167.32.133:8080

3、然后就可以使用

git clone http://github.com/weiheli/sass-zh.git
# 或
git clone http://github.com/weiheli/sass-zh.git

4、删除HTTP代理

git config --system (或 --global 或 --local) --unset http.proxy
git config --system (或 --global 或 --local) --unset https.proxy

以上就是关于设置HTTP代理的方式了,感兴趣的小伙伴不妨尝试下哦~

挂件 关闭
客服
二维码
客服二维码

加微信 领流量

大客户经理二维码

售前咨询,企业定制

专属客服竭诚为您服务