Skip to content
This repository was archived by the owner on Sep 3, 2019. It is now read-only.

Git and Proxy Servers

adamkerz edited this page Mar 12, 2015 · 1 revision

You can connect GIT to a proxy server by running the following:

git config http.proxy http://host:port

Local proxy/CNTLM:

If you use a local proxy such as CNTLM to authenticate through a corporate proxy server or for whatever other reason, you should be aware that you may experience a several minute delay in GIT making the first connection to the proxy. This could be caused by GIT/cURL resolving localhost to an IPv6 address first ::1 and trying to connect to that before timing out (in my case, after 2.5 minutes). The reason that Windows doesn't instantly refuse the connection is not known. After the timeout, cURL will then try the IPv4 version of 127.0.0.1. If your local proxy only listens on the IPv4 address (which seems a common occurrence), make sure you define the proxy as such:

git config http.proxy http://127.0.0.1:8080

Troubleshooting

To troubleshoot other problems with your proxy, you can set the following environment variables:

set GIT_TRACE=1
set GIT_CURL_VERBOSE=1

Then run the command again and you will get much more information about what GIT and the cURL library are up to.

Clone this wiki locally