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

Add new comment