[bower] Installing a dependency with Bower from URL and specify version

If you use bower.json file to specify your dependencies:

{
     "dependencies": {
         ...
         "photo-swipe": "[email protected]:dimsemenov/PhotoSwipe.git#v3.0.x",

#bower 1.4 (tested with that version) can read repositorios with uri format

         "photo-swipe": "git://github.com/dimsemenov/PhotoSwipe.git#v3.0.x",

     }
}

Just remember bower also searches for released versions and tags so you can point to almost everything, and can interprate basic query patterns like previous example. that will fetch latest minor update of version 3.0 (tested from bower 1.3.5)

Update, as the question description also mention using only a URL and no mention of a github repository.

Another example is to execute this command using the desired url, like:

bower install gmap3MarkerWithLabel=http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerwithlabel/1.0/src/markerwithlabel.js -S

that command downloads your js library puts in {your destination path}/gmap3MarkerWithLabel/index.js and automatically creates an entry in your bower.json file called gmap3MarkerWithLabel: "..." After that, you can only execute bower update gmap3MarkerWithLabel if needed.

Funny thing if you do the process backwars (add manually the entry in bower.json, an then bower install entryName) it doesn't work, you get a

bower ENOTFOUND Package gmapV3MarkerWithLabel not found