Git上好的资源太多了,公司上网都需要设置代理,这样使用"git clone http://github.com/..."下载代码时候,常报错"找不到host",解决方法如下:
1.打开终端
2.输入命令"export http_proxy=http://proxy:port",其中"proxy"是代理服务器名,”port“是端口号
如果git project是”https://github.com/..",则需要将上面命令中”http_proxy"改为“https_proxy".
Git上好的资源太多了,公司上网都需要设置代理,这样使用"git clone http://github.com/..."下载代码时候,常报错"找不到host",解决方法如下:
1.打开终端
2.输入命令"export http_proxy=http://proxy:port",其中"proxy"是代理服务器名,”port“是端口号
如果git project是”https://github.com/..",则需要将上面命令中”http_proxy"改为“https_proxy".
转载于:https://my.oschina.net/justdoit/blog/123986