Home » Nodejs » Bower git package with a commit id

Bower git package with a commit id

Posted by: admin November 17, 2017 Leave a comment

Questions:

Is it possible to include a github repo from a specific id?

For example I need angular.js repo with e12e584ca8db306dce8e0f4d3a212d77fbae966c id.

Is this possible?

 "dependencies": 
      "angular-my-repo":"https://github.com/angular/angular.js/tree/e12e584ca8db306dce8e0f4d3a212d77fbae966c",
      "moment": "~2.1.0"
 },

or what is the correct syntax?

Answers:
bower install --save git://github.com/angular/angular.js#e12e584ca8db306dce8e0f4d3a212d77fbae966c 

or

bower install --save https://github.com/angular/angular.js.git#e12e584ca8db306dce8e0f4d3a212d77fbae966c

see this thread

https://github.com/bower/bower/issues/856

Questions:
Answers:

In addition to Cemo‘s answer,
It is possible to install bower package from a commit using the char ‘#’

i.e

bower install --save package_name#commit_sha

e.g

bower install --save angular.js#e12e584ca8db306dce8e0f4d3a212d77fbae966c

This will add to your bower.json the depndency

"angular.js":"e12e584ca8db306dce8e0f4d3a212d77fbae966c"

Hope this helps!