Create a tunnel to github with the git default daemon port like this:
$ ssh -L9418:github.com:9418 myuser@myhomessh.com
And clone repositories replacing github.com
with localhost
, like so:
$ git clone git://localhost/someuser/someproject.git
If you want to preserve the “correct” metadata, there are several options
- replace localhost origin with github.com after cloning
git remote rm origin git remote add origin git://github.com/someuser/someproject.git
- add github.com to your hosts file and point it to 127.0.0.1
- add github.com to your ~/.ssh/config:
Host github.com HostName localhost
- use your favourite packet forwarder, example for Mac OS X:
sudo ipfw add 00100 fwd 127.0.0.1,9418 tcp from me to github.com dst-port 9418
and when you are done, don’t forget to remove it:
sudo ipfw delete 00100
(use caution, especially if you are using ipfw already and have rule 00100 in place)
Stuck behind a corporate firewall? Justin Bailey has a good guide. Scroll down for a *nix solution as well.
This isn't my guide, it was just submitted by a user. There are some other guides over at http://help.github.com/firewalls-and-proxies/ if they help. Smart HTTP might be your best bet.