Git through an NTLM Proxy (Corporate Firewall) for drupal.org

Borrowing from answers in this Stack Overflow question, here's how you can get through a corporate (Microsoft) NTLM Proxy to clone git repositories from drupal.org:

cd into your drupal contrib directory (or wherever you want to put the repository).

$ export http_proxy="http://username:password@proxy:port/"

$ git clone http://git.drupal.org/project/[projectname]

Basically, you're first setting an environment variable to tell your shell to use an HTTP proxy, with your username/password combo. This variable will be used when making connections to git.drupal.org (and other services, like github). You can also set this in your ~/.profile, .bash_rc, or .bash_profile so it will be saved for future Terminal sessions.

If the above method doesn't work, you could do a couple other things - try setting up a local proxy on your own computer. You could use NTLMaps for linux/bsd/osx (I use this to share my proxied connection over WiFi to iOS devices), or use Authoxy for the Mac, and then authenticate against your own localhost proxy on a port of your choosing. This works better for more restrictive firewalls.

For example, if you use NTLMaps or Authoxy, you may be able to get away with just setting a git config variable:

$ git config --global http.proxy http://localhost:[port]

Comments

Your first two commands will not work through a NTLM proxy unless you're using Git 1.7.10 onwards, see my updated comment on the stackoverflow question you linked.

with this configuration we can only clone htpp and what about git clone git://github.............. ???

dose not work with a ntlmaps configiration

what is the solution

On Windows, you can use Px for Windows which can punch through NTLM proxies without having to configure the username/password. As long as it is running on a Windows system that has logged onto the domain, it can authenticate on that user's behalf. Makes life super easy for tools like Git.

http://github.com/genotrance/px