Larry Martell
Larry Martell

Reputation: 3756

can't clone repo from bitbucket on Ubuntu

I am trying to clone a repo from Bitbucket on Ubuntu and it fails with:

fatal: https://[email protected]/owner/repo.git/info/refs not valid: is this a git repository?

But if I execute the exact same command on my Mac it works fine.

The command I am using is:

git clone https://[email protected]/owner/repo.git

What could be the issue on Ubuntu?

Upvotes: 4

Views: 4736

Answers (2)

CodeWizard
CodeWizard

Reputation: 141946

Use the ssh protocol instead of http/https.

Using http/https you will have to type your password every time you have to "talk" to the server.

Using ssh will use the ssh keys and you will not have to type in username password every time.

git clone [email protected]:owner/repo.git

Permission denied (publickey)

You get this error since you don't have ssh keys on any of your platforms. Set the keys, add them to your account and you are all set to go.


Create ssh keys

# create the key pair.
ssh-keygen -t rsa

# echo the key (pub) to the screen and copy it to clipboard
cat ~/.ssh/id_rsa.pub

Add the keys to your bitbucket account

  • Login to your Bitbucket account
    Choose avatar > Settings from the application menu.

  • Choose SSH keys and paste the key you have copied from the first step

enter image description here


Note:

Repeat this step on each machine you need to connect to your account or copy the same keys to all your machines. Both ways will work.

Upvotes: 6

SachinSunny
SachinSunny

Reputation: 1819

I think the command would be either https

git clone https://bitbucket.org/owner/repo.git

or ssh

git clone [email protected]:owner/repo.git

Upvotes: 0

Related Questions