I've just created a repo in my account and I can't push

I've just created a repo in my account and I can't push

I can push to my other Bitbucket repositories and I can pull from other private repositories I have access to but I can't push to this one.

 

Cloning into 'wpdoctest'...

Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

 

Adding it as remote does not work either

git remote add origin git@bitbucket.org:xxxxx/wpdoctest.git 

git push -u origin master

 

Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

 

Please note again that I can push to my other Bitbucket repositories and I can pull from other private repositories I have access to but I can't push to this one (and it's mine).

 

2 answers

I've noticed that it works with the https url:

git remote add origin 

https://xxxxx@bitbucket.org/xxxxx/wpdoctest.git

but Bitbucket suggests the git url that does not work.

The other repos have the https url as well.

It's likely that your SSH agent isn't running, or doesn't have the appropriate key(s) added. Is your key listed when you run `ssh-add -L`? Does Bitbucket come back with your username if you run `ssh -T git@bitbucket.org`?

ssh-add -L returns "The agent has no identities."

ssh -T git@bitbucket.org returns "Permission denied (publickey)."

Thank you.

0 vote

Have you added your SSH key in the git repository permission?

Check https://confluence.atlassian.com/bitbucketserver/ssh-user-keys-for-personal-use-776639793.html for details

Yes, as I said in my previous reply, it works for the other repositories and for this repository with the https url. It doesn't let me add it to the repository as I already have it in the account.

This is Bitbucket Cloud. If the user account has the key then it doesn't need to be added to any specific repo.

@James RedmondAh ok, didn't notice that :)

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

712 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot