I'm a programmer specialising in performant and scalable systems using PHP and Ruby and cooking


Published:

git protocol blocked? Always use https

In my office the internal firewall actually blocks outgoing git protocol. Whilst not normally a problem this can be a pain when working with tools such as Bower which will default to using the git protocol to clone packages from Github. Some tools also offer no way to adjust this behavior or make it such that it takes more time to make the change per project than it takes to clone the repos by hand.

Thankfully git provides a global way of making this change for all projects and future downloads:

git config --global url."https://".insteadOf git://  

This will ensure all clone, push, pull requests will use https instead of git. Obviously this can be reversed to switch this behavior back.