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

This widget could not be displayed.

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
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

877 views 2 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