9

I am working behind a proxy and I can't access github.com. I read that cntlm can fix this issue. I am still struggling with filling the proxy information.

So my question is, how to point Git to use cntlm to bypass the proxy?

AjayKumarBasuthkar
  • 2,885
  • 2
  • 23
  • 27
Mohamed Ramadan
  • 475
  • 2
  • 7
  • 15

2 Answers2

28

In case you actually would want to use CNTLM, it would be configured to git like a regular proxy.

So where you would specify your NTLM proxy like this:

git config --global https.proxy https://user:password@proxy.com:port
git config --global http.proxy http://user:password@proxy.com:port

For CNTLM, you'd just specify your port where CNTLM would be listening at, using localhost:

git config --global https.proxy https://127.0.0.1:port
git config --global http.proxy http://127.0.0.1:port

I have it running on local port 3128, so for me it is

git config --global https.proxy https://127.0.0.1:3128
git config --global http.proxy http://127.0.0.1:3128

Even if NTLM proxy is supported by git, you might not want to use it that way as it stores your user/pass in clear text. With CNTLM, you have the possibility of using a centralized location where password can be stored as encrypted.

eis
  • 51,991
  • 13
  • 150
  • 199
  • 3
    If you are using CNTLM, make sure you point the proxy to `127.0.0.1` instead of `localhost`, as suggested. In Windows, it appears that localhost points first to the IPv6 address, which CNTLM doesn't listen to. As such, git will wait until the timeout (several minutes) before switching to the IPv4 address. – Ronan Paixão May 14 '15 at 13:47
6

You don't need CNTLM for git version 1.7.10 and newer, as it's your case.

See my answer here https://stackoverflow.com/a/10848870/352672 for details, you can just configure/test this way:

git config --global http.proxy http://user:password@proxy.com:port
git clone http://git.gnome.org/browse/gnome-contacts
Community
  • 1
  • 1
Nelson
  • 49,283
  • 8
  • 68
  • 81