Exclude hosts or domains with git proxy

2019-09-09 17:46发布

问题:

I use git behind a firewall and I need to configure

$ git config --global http.proxy

to handle connection.

But what happens if I only wanna avoid proxy for local domains? I need the proxy for every host excepts for servers in my LAN.

There is a way to do?

Thanks

回答1:

You can define an environment variable no_proxy in order to avoid the proxy for a specific domain:

no_proxy=.mycompany

The other approach, since git 1.8.5+, is to set a proxy per url.