Bower install using only https?

arootbeer picture arootbeer · Mar 27, 2013 · Viewed 69.7k times · Source

I am trying to set up Bower on a build server at our organization's data center, but git's port does not appear to be open on the data center's firewall. I can use the git command line client to clone via https://[repo], but not git://[repo].

Is there a switch or preference which will instruct bower to perform git clone using https rather than the git protocol?

I've looked at the source, and considered changing the resolution code to replace git:// with https://, but I figured I'd ask before I go to those lengths.

Answer

Sindre Sorhus picture Sindre Sorhus · Mar 28, 2013

You can make git replace the protocol for you. Just run:

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

to use HTTPS protocol instead of Git.