I\'ve tried both using export http_proxy=http://[username]:[pwd]@[proxy]
and git config --global http.proxy http://[username]:[pwd]@[proxy]
.
I've been using ntlmaps and been having good results getting through windows/NT proxies: http://ntlmaps.sourceforge.net/
The git configuration is:
git config --global http.proxy http://localhost:5865
Cloning works for me but only over HTTP (since our corporate firewall blocks the ssh/git protocols):
$ export http_proxy="http://username:password@proxy:port/"
$ git clone http://github.com/sunlightlabs/fiftystates_site.git fifty
Initialized empty Git repository in /home/user/fifty/.git/
got e15f5192b923d8e87abaeb9406d0f4d80403da09
walk e15f5192b923d8e87abaeb9406d0f4d80403da09
got a78b792191f1cf5e961753dcfe05e9c809bdb0ed
got 76e6e86e72a0f998f7663da69ca49c457a302e27
walk 76e6e86e72a0f998f7663da69ca49c457a302e27
got 35b68a3b876fb90e73ba7a7eb51432e825ef2aa3
...
Github suggests cloning via git://github.com/...
but you have to change it to http://github.com/...
manually.
Edit: I'm using git version 1.5.6.3.
Hope that helps!
You can also use cntlm,
http://cntlm.sourceforge.net/
A solution similar to ntlmaps but written in pure C. It works in the same way as ntlmaps by creating a local proxy server (127.0.0.1) at a port (3128 default) on your machine. This new locally created proxy server does not require any authentication and thus can be used with any application that supports http proxy. It can also create a local socks proxy if you need one.
The main advantage over ntlmaps which is written in python, is that cntlm has very low CPU and RAM usage, typically <2%.
TL/DR:
export GIT_HTTP_PROXY_AUTHMETHOD=basic
or
git config --global http.proxyauthmethod basic
I had the same issue when git (curl) proxy auth did not work. Credentials were right. Upgrade to the latest git-v2.15.0 did not help.
The issue was due to wrong proxy authentication method chosen by git-libcurl.
The valid proxy_authmethod options are defined in git source: https://github.com/git/git/blob/d0e9983980a25e0c398cc03342e5ad22ef85b8a8/http.c#L81
The proxyauthmethod can be defined either through GIT_HTTP_PROXY_AUTHMETHOD
environment variable or http.proxyauthmethod
git config option. Environment variable overrides the config option value.
In order to use default NTLM credentials, provide an empty username and password
git config --global http.proxy https://:@proxy:port
Instead of setting proxy for git, npm, etc. you can use Firewall Client for ISA Server from Microsoft. After installation:
Start > Autostart > Microsoft Firewall Client Management
Settings tab > Manual specified ISA Server > proxy:port
Web Browser tab > Uncheck "Enable web browser automatic configuration."
I have stumbled on a more easier and possibly safer solution that works not just for git but also any command based installers
One solution running all your traffic from command line is proxied with authentiction.
Wont expose your password in the user:password@domain:port format
Solution:
Download Fiddler, It has a built in way to add authentication headers to all requests.
Once running menu Rules-> Automatically Authenticate (Tick that)
Then for git
git config --global http.proxy http://localhost:8888
git config --global https.proxy http://localhost:8888
Thats it!