Git through a proxy


===Even easier than subversion===
No hidden directory configuration files to mess with. If you’re given a url to ‘git’, it’s probably something like this:

$ git clone git://anongit.freedesktop.org/git/mesa/drm

If you’re behind a proxy and you run that, you’ll get something like “the other end hung up” or “Cannot get remote repository information” because git is trying to connect using port 9418 by default. I found a few sites saying all you need to do is change git to http in the url and it will work, but that did not work for me. But it’s an easy fix. Change git’s http.proxy and you’re done. Here’s how: (replace my proxy host and port 8002 with your own)

$ git config –global http.proxy http://rootninja.proxy.com:8002

If that doesn’t work, try exporting your http_proxy environment variable first.

$ export http_proxy=rootninja.proxy.com:8002

You don’t even need to change the git url to start with http. The original url will work:

$ git clone git://anongit.freedesktop.org/git/mesa/drm


Posted on September 16th, by admica in howto, networking.
Comments Off

Comments are closed.