Look, sometimes, you need to work wherever you can. I found myself in a similar situation recently, crusing at 30,000ft, trying to ship some code for Crowdsync. Connected to wifi (JetBlue’s wifi is FANTASTIC), editing code was no problem. However, when I went to push to git:
If you’ve ever had this happen, there’s an easy solution. If you’re using SSH, chances are, the network you’re connected to blocks the standard SSH port (22). But, they’ll likely have standard ports open, like 80 and 443. Lucky for us, Github allows us to connect to a repo via SSL, instead of SSH.
So, if you want to push to Git while on a plane (or wherever you can’t access SSH):
- Grab your SSL url for your repo. Do this by selecting “Use HTTPS” in the menu that the “Clone or download” button pops out:
- Add a new remote with that URL:
git remote add nossh https://github.com/username/repository.git
- Start pushing and pulling to that remote, instead of the one you usually use, and boom, you’re in business!
Hope this helps you in times where you need to push to Github, but you’re blocked for whatever reason. It’s great on airplanes, and probably good for other restricted scenarios as well.
Special thanks to Josh for the tip on figuring this out!
(BTW - this post was also written and pushed to Git at 30K feet - putting our money where our mouth is!)