I have one project on Gitlab and I worked with it for the last few days!

But after a few days it all went off! I added my home PC ssh key in Gitlab project setting, but now I want use git pull for receive new changes in my home PC show me this error:

10:47 AM    Update failed
                    Permission denied (publickey).
                    Could not read from remote repository.

                    Please make sure you have the correct access rights
                    and the repository exists.

10:47 AM    Update canceled

Gitlab ssh key image: enter image description here

How can I fix it?

1 Answers

Ashish Shah On

GitHub isn't able to authenticate you. So, either you aren't setup with an SSH key, because you haven't set one up on your machine, or your key isn't associated with your GitHub account.

You can also use the HTTPS URL instead of the SSH/git URL to avoid having to deal with SSH keys. This is GitHub's recommended method.

Further, GitHub has a help page specifically for that error message, and explains in more detail everything you could check.

I know this problem. After add ssh key, add you ssh key to ssh agent too (from official docs https://help.github.com/articles/generating-ssh-keys/)

ssh-agent -s
ssh-add ~/.ssh/id_rsa

After it, all work fine, git can view proper key, before couldn't.