Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

git push -u origin master -> Permission Denied

wdchild August 29, 2019

When I try pushing my git repository to the repository on Bitbucket, I get the following error:

 

Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

 

Sorry, I'm pretty new to github and Bitbucket, and am still trying to get the hang of this. I was trying to use a private repository. Not sure if that is part of the issue.

2 answers

2 votes
wdchild August 31, 2019

It turns out that the answer was to create a new ssh key on my own computer and to copy the public key to bitbucket. After that, push origin master worked just fine.

Prashant September 3, 2019

@wdchild  That's great. Thank you for sharing the answer.

0 votes
Prashant August 29, 2019

Hi @wdchild ,

Please do find the link "https://www.atlassian.com/git"

and this is the commands help you out to push the file.

  1. git init
  2. git add filename
  3. git commit -m "message"
  4. git remote add origin "url of repo"
  5. git push --set-upstream origin master
  6. git push origin master

Thank you,

Regards,

Prashant

wdchild August 29, 2019

Thanks for answering, but I still get the error at step 5.

 

...$ git push --set-upstream 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.

Like animesh1992 likes this
animesh1992 November 21, 2021

Same error. I get "Unauthorized" fatal: Could not read from remote repo.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events