Installing a specific commit, branch or version from a git repository with bower

August 27, 2013

Installing packages via bower is awesome.

It’s even more awesome that you’re able to install git repositories with bower.
This will become handy if you have private repositories.

Installing git repositories with bower:

bower install --save

This will clone the jquery git repository from github to your local machine and then checkout the master branch to your bower folder.

It could only become a problem in the future, since you would get all the changes from the master branch.

Specifing a commit, branch or version of your git repository is thankfully not that hard.

To install a specific commit:

bower install --save

To install a specific branch:

bower install --save

To install a specific version:

bower install --save

Hopefully you’re now more safe to updates in the future.