Unable to push to remote repo Edited

Hi, when I try to push my local repo to my remote bitbucket one I get the following error message:

 

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags --set-upstream origin refs/heads/master:refs/heads/master

Pushing to git@bitbucket.org:hdykiel/career-exploration.git

Permission denied (publickey).

fatal: Could not read from remote repository.

 

Please make sure you have the correct access rights

and the repository exists.

Pushing to git@bitbucket.org:hdykiel/career-exploration.git

Permission denied (publickey).

fatal: Could not read from remote repository.

 

Please make sure you have the correct access rights

and the repository exists.

Pushing to git@bitbucket.org:hdykiel/career-exploration.git

Permission denied (publickey).

fatal: Could not read from remote repository.

 

Please make sure you have the correct access rights

and the repository exists.

Pushing to git@bitbucket.org:hdykiel/career-exploration.git

Permission denied (publickey).

fatal: Could not read from remote repository.

 

Please make sure you have the correct access rights

and the repository exists.

Completed with errors, see above

 

I created a SSH key but when I try to add the key to bitbucket I get the error message "Invalid access key". I'm using a MAC. Can you help?

  

Thank you!

1 answer

Can you please check if your key is loaded to ssh-agent? Use below command on terminal to check that

ssh-add -l

If no key is listed, please add it to the agent with below command,

ssh-add <path_to_key>

More like,

ssh-add ~/.ssh/id_rsa

 

If you have added the account in Sourcetree, you can go to accounts section in Preference window, click on edit key and copy the key associated with the account and login to bitbucket on browser and add the key there. 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 11, 2018 in Sourcetree

Tip from the team: debugging Sourcetree

Supported Platforms macOS Windows If you're reading this and it's not just educational… we know you're unhappy right now and apologize for that   We're dedicated to improving yo...

464 views 7 6
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