Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Bower with private Bitbucket repository?

Tags:

I'm working on a project, where I have some public bower components, and I'm writing some of my own. But, I don't want to publish/register it on bower registry. I wan't to use my PRIVATE Bitbucket repository.

So, if i type in terminal: bower install my_package_name I want to download that package from my private repo.

I get the idea, that I should specify the git repo in bower.json file, but what I'm struggling with is authentication through terminal.

like image 652
Lado Lomidze Avatar asked Jan 21 '15 15:01

Lado Lomidze


People also ask

Are Bitbucket repositories private?

When you create a Bitbucket Cloud repository, you specify whether it's private or public, but you can also change this setting at any time. If your repository is public, anyone can access and fork it. If your repository is private, you can specify who exactly can access your repository and whether they can fork it.

Can GitHub connect to Bitbucket?

Click the gear icon and select Accounts. Click Add from the Accounts tab. After you select a Host, enter your hosting details. If you selected Bitbucket or GitHub, keep the default Auth Type and click Connect Account to enter your credentials.


2 Answers

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

{    "dependencies" : {        "my_package_name" : "https://[email protected]/MY_REPO_URL.git"    } } 

Or with SSH:

{     "dependencies": {         "my_package_name": "[email protected]:username/MY_REPO_URL.git"     } } 

This works like a charm.

like image 172
Lado Lomidze Avatar answered Oct 12 '22 12:10

Lado Lomidze


Use SSH-like clone URL:

{     "dependencies": {         "my_package_name": "[email protected]:user/repo.git"     } } 

Your system should have authorized SSH key.

It works for me! Good luck!

like image 31
Serge K Avatar answered Oct 12 '22 10:10

Serge K