rogerxu / git-tips

Tips for Git
Apache License 2.0
2 stars 3 forks source link

Bypass Git Proxy #25

Open rogerxu opened 7 years ago

rogerxu commented 7 years ago

We want to bypass some domains for git proxy.

rogerxu commented 7 years ago

github - Only use a proxy for certain git urls/domains? - Stack Overflow

Note:

both HTTP_PROXY and HTTPS_PROXY must use the http:// url of the proxy (no https://). always use the fqn (full qualified name) of proxydomain (don't rely on its short name) But for internal repo, all I have to do is define and export one more environment variable:

no_proxy=.my.company,localhost,127.0.0.1,::1, for accessing any repo with an address like myrepo.my.company or localhost.

rogerxu commented 7 years ago

http.<url>.*

Any of the http.* options can be applied selectively to some URLs.

$ git config --global http."https://github.com".proxy http://ppc.vnet.link:8800
$ git config --global http."https://gitlab.com".proxy http://127.0.0.1:1984