a little place I like to call home.

Getting a Git Repository to Clone through Panera WiFi (or any other public WiFi hotspot)

Jun. 4, 2015

If you are a developer and you work in public hotspots you have indoubtable ran into an issue where you try to pull down a repository from Github through the git:// protocol and you get this error:

fatal: unable to connect to[0:]: errno=Connection refused

Here is how I've solved it for my case (yes, there are many other ways like switching to https or http protocol).

You'll need a could based server that you can SSH into and access to your /etc/hosts.

Do this:

ssh -L

then edit your /etc/hosts

echo '' | sudo tee --append /etc/hosts

How this works is Panera (and many other public wifi hosts) will block port 9418 which is the git:// protocol. So our solution is to redirect our local traffic through our cloud server (the ssh command). While this might work for one-off commands (simple git clone git://), I had 20 repositories to clone (Rails project) and changing all the entries to use localhost wasn't going to be productive, using the /etc/hosts trick helps with this.

comments powered by Disqus