如何暂时禁用git http代理 [英] How to temporarily disable git http proxy

查看:221
本文介绍了如何暂时禁用git http代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在企业防火墙后面使用git,并且使用http.proxy --global config成功克隆了外部项目。



我的问题出现在我想要通过Intranet上的http进行克隆。我怀疑代理配置会干扰内部网请求。



我知道我可以在使用内部网之前重置配置,但这不是非常方便用户使用。



我也看到了这个答案,但它似乎只适用于现有的存储库。



是否有一种方法可以仅为一个命令调用停用代理使用情况?在这种情况下,最初的克隆是什么?

解决方案

我总是设置:

< pre $ no_proxy = .mycompany

export 如果我在Unix上,或者在Windows上设置简单的 set

这足以绕过所有以 .mycompany 结尾的内联网网址的代理。



请参阅示例:





我在自己的项目中使用它: .proxy.example

  export http_proxy = http:// username:userpassword@server.company:port 
export https_proxy = http:// username: userpassword@server.company:port
export no_proxy = .company localhost


I am using git behind a corporate firewall, and I am successfully cloning external projects by using the http.proxy --global config.

My problem arises when I want to clone through http on the intranet. I suspect that the proxy config interferes with the intranet request.

I know I could reset the config before using the intranet, but that is not very user friendly.

I also saw this answer, but it seems to apply only to an existing repository.

Is there a way to deactivate the proxy usage only for one command invocation? In this case, the initial clone?

解决方案

I always set:

no_proxy=.mycompany

(export if I am on Unix, or a simple set on Windows)

It is enough to bypass the proxy for all intranet url ending with ".mycompany".

See for an example:

I use it in my own project: .proxy.example:

export http_proxy=http://username:userpassword@server.company:port
export https_proxy=http://username:userpassword@server.company:port
export no_proxy=.company localhost

这篇关于如何暂时禁用git http代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆