git设置HTTP代理

来源:互联网 发布:淘宝与03年的非典 编辑:程序博客网 时间:2024/04/29 08:30

设置HTTP代理

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

执行下面两条语句

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

如果需要用户名和密码

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

然后就可以使用

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

不能用

git clone git@github.com:weiheli/sass-zh.git

删除HTTP代理

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

GitHub Desktop

如果使用Github推出的桌面程序GitHub Desktop,里面可能并没有代理设置的选项,不过这些客户端一般在底层都是调用的命令行工具,所以同样按照上述步骤进行设置即可。


0 0
原创粉丝点击