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 Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

274 views 0 3
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