让git使用代理服务器 [英] Getting git to work with a proxy server
本文介绍了让git使用代理服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何让git使用代理服务器?
How do I get git to use a proxy server?
我需要检查git服务器的代码,它每次显示请求超时。我如何解决这个问题?
I need to check out code from a git server, it shows "Request timed out" every time. How do I get around this?
或者,我该如何设置代理服务器?
Alternatively, how can I set a proxy server?
推荐答案
使用命令:
Command to use:
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
- 更改
proxyuser $ c $ $>
- 将
proxypwd
更改为您的代理密码
- 更改
proxy.server.com
到您的代理服务器的URL
- 更改
8080
到在代理服务器上配置代理端口
- change
proxyuser
to your proxy user - change
proxypwd
to your proxy password - change
proxy.server.com
to the URL of your proxy server - change
8080
to the proxy port configured on your proxy server
如果您决定随时重置此代理并在没有代理的情况下工作:
If you decide at any time to reset this proxy and work without proxy:
使用命令:
Command to use:
git config --global --unset http.proxy
最后,检查当前设置的代理:
Finally, to check the currently set proxy:
git config --global --get http.proxy
这篇关于让git使用代理服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- 将
查看全文