How to use Bower with private Bitbucket repository? How to use Bower with private Bitbucket repository? git git

How to use Bower with private Bitbucket repository?


Ok, since nobody answered, I figured it out by myself. You can use with HTTPS like this:

{   "dependencies" : {       "my_package_name" : "https://username@bitbucket.org/MY_REPO_URL.git"   }}

Or with SSH:

{    "dependencies": {        "my_package_name": "git@bitbucket.org:username/MY_REPO_URL.git"    }}

This works like a charm.


Use SSH-like clone URL:

{    "dependencies": {        "my_package_name": "git@bitbucket.org:user/repo.git"    }}

Your system should have authorized SSH key.

It works for me! Good luck!


You can connect with HTTPS or SSH. You can find the connection string under the overview page of your Bitbucket repository.To use ssh you need to setup ssh.

You can use HTTPS:

bower install https://YOUR_USER_NAME@bitbucket.org/YOUR_USER_NAME/PROJECT_NAME.git --save

or use SSH:

bower install git@bitbucket.org:YOUR_USER_NAME/PROJECT_NAME.git --save

Or add it in your bower.json file as a dependency and run :

bower install

HTTPS - bower.json file:

"dependencies": {  "PROJECT_NAME": "https://YOUR_USER_NAME@bitbucket.org/YOUR_USER_NAME/PROJECT_NAME.git"}

SSH - bower.json file:

"dependencies": {  "PROJECT_NAME": "git@bitbucket.org:YOUR_USER_NAME/PROJECT_NAME.git"}

To setup ssh for Bitbucket follow the instruction in their documentation:Set up SSH for Git