Using GIT through a SOCKS proxy

Step OneCreate a wrapper script for netcat

First you need netcat (a utility named nc). It's probably already on your
system. The version in F9 just works.

Git needs a command that it can just pass a host and port to, but nc takes
a few more arguments, so you need to make a wrapper script. You could put it
in /usr/bin or your own /home/user/bin directory or something. Do this:

cat > /somepath/bin/proxy-wrapper
#!/bin/bash
nc -xproxy:1080 -X5 $*

Then hit Ctrl-D to save the file. This assumes you're using a SOCKS version
5 proxy server named "proxy".

Note
If you're on Ubuntu, your version of netcat probably doesn't support the -x
and -X flags. You can update it to the version that does work, like this:

$ sudo apt-get install netcat-openbsd

Step TwoMake your script executable

$ chmod +x /somepath/bin/proxy-wrapper

Step ThreeSet the git proxy environment variable

Either temporarily for this session, or permanently in your ~/.bashrc, do:

$ export GIT_PROXY_COMMAND="/somepath/bin/proxy-wrapper"

If you also need to access local git servers behind your proxy server, you
don't want this to be set permanently.

Step FourProfit

Now you should be able to get to git trees using git:// protocol (port 9418)
through your proxy.