1

When I push my project files on my local machine to online repository, it gives me 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.

I also tried this but to no avail. Does anyone know what might be the root cause?

Doej
  • 75
  • 5
  • Possibly you do not have access to repository or it is read only for you. Check on github website in project setting the "Collaborators" tab and see if you have write access. Also it could be issue with public & private key, are they correctly set up? – Mateusz Chrzaszcz Jul 22 '17 at 17:30
  • Have you added your `~/.ssh/id_rsa.pub` into your GitHub account? – Sajib Khan Jul 22 '17 at 17:37
  • I never set up public/private keys and it worked for me before. I am not collaborating to this project; I created a repo and just want to push stuff to online repo @MateuszChrzaszcz – Doej Jul 22 '17 at 17:38
  • If it still doesn't work show the full result of `git remote show origin`. To check for credentials show the results of `git config --list --show-origin`. – Christoph Jul 23 '17 at 16:47

1 Answers1

3

The Permission denied (publickey) error means that the server rejected your connection. There could be several reasons .

  • correct key
  • corect server
  • correct user
  • ...

The must commun reason is that you dont have deployed your ssh key in github server . So check the server , also you need to check your .ssh if your ssh keys are in it .

for other probelms you can check this link : https://help.github.com/articles/error-permission-denied-publickey/

rnside
  • 41
  • 6
  • Isn't there a way to get credentials based on my username and password instead of keys? I never used keys before and I was able to push stuff before. @rnside – Doej Jul 22 '17 at 17:44
  • @Doej who is managing the git repo for this project ? maybe they had changed acces policy ( coz you said that it was working before ) . – rnside Jul 22 '17 at 17:56
  • Other way of getting credentials is GPG key , you can sign and verify tags and commits. With GPG keys. – rnside Jul 22 '17 at 17:58
  • other git operation on remote repo except the push are working ? – rnside Jul 22 '17 at 18:09