Unable to push to remote repo

Hadrien Dykiel December 26, 2017

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

0 votes
Manju
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 22, 2018

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
TAGS
AUG Leaders

Atlassian Community Events