Open rogerxu opened 7 years ago
github - Only use a proxy for certain git urls/domains? - Stack Overflow
HTTP_PROXY=http://username:password@proxydomain:port
HTTPS_PROXY=http://username:password@proxydomain:port
NO_PROXY=localhost,127.0.0.1,::1,.gitlab.com
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
.
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
We want to bypass some domains for git proxy.