github作为世界最大的开源代码仓库,有着各种各样的优秀开源项目,但是由于服务器在国外,下载速度一直都是大陆程序员的痛。下面来教教大家如何设置git的http代理,通过代理来实现加速功能。
1.临时设置方法(关闭命令终端代理就消失)
windows的cmd
set http_proxy=http://192.168.88.1:1080 set https_proxy=http://192.168.88.1:1080
linux系统或是windows下使用git bash
export http_proxy=http://192.168.88.1:1080 export https_proxy=http://192.168.88.1:1080
该命令同时也支持debian的apt-get以及centos的yum
2.永久设置方法
添加http代理
git config --global http.proxy http://192.168.88.1:1080 git config --global https.proxy http://192.168.88.1:1080
删除http代理
git config --global --unset http.proxy git config --global --unset https.proxy
文章作者:沃航科技