If you’re like me and spend a lot of time on the wrong side of a corporate firewall, you’ll appreciate this tip on how to get things done when the git protocol port is blocked.
All I was trying to do was use grunt to fetch some required dependencies for a node.js library needed for a new project. That’s all. Really.
The library was converse.js, and among the dependencies I needed were strophe, backbone and, of course, jquery.
Problem was that my grunt fetch attempts kept timing out with connect errors.
As they say on SpongeBob, “five hours later…”, I finally figured out the problem. The freaking port for the git protocol was being blocked by the company firewall.
Fortunately, everything I was after is hosted up on GitHub and so available over HTTPS — a protocol that is never blocked.
The trick to getting everything to work lay in a simple modification to my git client configuration.
git config --global url."https://".insteadOf git://
What this looks like inside .gitconfig is:
[url "https://"] insteadOf = git://
Making that change caused git to connect to https://github.com wherever a parameter file said to use git://github.com, allowing everything to fetch and build as required.
I don’t blame anyone in the end other than myself. After my sixth attempt I should have realized the problem was something fundamentally “wrong” with the infrastructure I was using (apart from acoustic modem-slow download speeds).
Ah, welcome to software development in corporate America!
Thanks to Nathan S. Watson-Haigh for this solution, posted over on Stackoverflow as response #129 back in May 2012.