I've cloned a private repo, forked it and made som changes into a feature branch. When I try to push these changes into the repo i get the following message:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I've tried to delete the git credentials from my windows computer controlpanel>credentials but it's still showing me the same error.
Is there any chance that I have to log in and out from my terminal to git? If that would be the case, how do I do that?
I've also tried to push with git push --set-upstream origin but it's just showing me the same error.
Have anyone of you seen this before?
Thanks beforehand, Erik
"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"
This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:
More help available from GitHub on creating SSH Keys.
This can be your ssh key is not authorised - Permission denied (publickey).
Solution 1
Check if GitHub protocols are not from ssh to https
check remote url
git remote -v`
Change remote url
git remote set-url origin https://URL
Solution 2
if after setting ssh key it still fails you might require system restart
Solution 3
This is not a solution just work around for newbies to clone public repo without caring protocols
Use this example
git clone https://github.com/%REPOSITORYFOLDER%/%REPOSITORYNAME%.git
Instead of
git clone [email protected]:%REPOSITORYFOLDER%/%REPOSITORYNAME%.git
all these solutions are collected from different sources will update it if more solution found which works for such scenarios
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With