git 如何配置 Eclipse EGit 以使用自定义代理设置?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6615121/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to configure Eclipse EGit to use custom proxy settings?
提问by robamaton
I'm behind a corporate firewall, so most of the time (e.g. Eclipse updates) I want to be going through a proxy. However, the servers I pull from in Git are all internal. I currently have to change my proxy settings every time I switch, but I'd like to set it up so that EGit uses a direct connection.
我在公司防火墙后面,所以大部分时间(例如 Eclipse 更新)我想通过代理。但是,我从 Git 中提取的服务器都是内部的。我目前每次切换时都必须更改我的代理设置,但我想设置它以便 EGit 使用直接连接。
My guess is that it's just not a feature EGit has, but can anyone think of a workaround maybe?
我的猜测是它不是 EGit 的功能,但有人能想到解决方法吗?
Thanks!
谢谢!
回答by VonC
EGit should follow the General > Network configuration settings.
If you set that Network mode to "Manual", you can:
EGit 应遵循常规 > 网络配置设置。
如果将该网络模式设置为“手动”,则可以:
- set your proxy (with authentication)
- add sites you want in "no_proxy" (in order to nottry to contact a proxy)
- 设置您的代理(带身份验证)
- 在“no_proxy”中添加您想要的站点(为了不尝试联系代理)
This seems also valid for ssh protocol, as illustrated by bug 349702.
这似乎也适用于 ssh 协议,如错误 349702 所示。
回答by Niko
For me the answer of VonC didn't work (Eclipse Neon.2). I had to enter my proxy at the Settings under:
对我来说,VonC 的答案不起作用(Eclipse Neon.2)。我必须在“设置”下输入我的代理:
Window -> Preferences
窗口 -> 首选项
and then General -> Network connections
然后常规 -> 网络连接
Also note that some proxy servers block the git:// and ssh:// protocols. If you face issues, try to use the https:// or http:// protocol.
另请注意,某些代理服务器会阻止 git:// 和 ssh:// 协议。如果您遇到问题,请尝试使用 https:// 或 http:// 协议。