Using Bower without Git

Bower is a really useful tool for pulling in front-end dependencies. However, as it says right upfront on the website, it requires Git, so if your organisation uses Subversion and you can't rely on Git to be available on the path, you're ostensibly stuck. I've found that you can work around this, though.

Although Bower says it requires Git, it will install and run without complaint until it actually tries to fetch a package via Git, at which point you'll get an error. But whilst Git is the primary mechanism used to fetch packages in Bower, it's not the only one — Subversion checkout is available as well. What's more, GitHub itself supports checking out a repo with Subversion, so you can successfully install a package from GitHub, without Git, like this:

$ bower install svn+https://github.com/jquery/jquery --save-dev

Here's how that comes out in the bower.json:

{
  "name": "My Project",
  "version": "0.0.1",
  "devDependencies": {
    "jquery": "svn+https://github.com/jquery/jquery"
  }
}