20131126 git behind the corporate firewall - plembo/onemoretech GitHub Wiki

title: Git behind the corporate firewall link: https://onemoretech.wordpress.com/2013/11/26/git-behind-the-corporate-firewall/ author: phil2nc description: post_id: 6660 created: 2013/11/26 16:39:50 created_gmt: 2013/11/26 21:39:50 comment_status: closed post_name: git-behind-the-corporate-firewall status: publish post_type: post

Git behind the corporate firewall

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.

Copyright 2004-2019 Phil Lembo