# git push fails with the following
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Steps
0. copy your public key to github.com
cat ~/.ssh/id_rsa.pub >> copy the content
1. go to github.com > settings > ssh and gpg keys > new ssh key > paste your public key there > save
Try git push again.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Steps
0. copy your public key to github.com
cat ~/.ssh/id_rsa.pub >> copy the content
1. go to github.com > settings > ssh and gpg keys > new ssh key > paste your public key there > save
Try git push again.
Permanently authenticating with Git repositories,
ReplyDeleteRun following command to enable credential caching:
$ git config credential.helper store
$ git push https://github.com/repo.git
https://stackoverflow.com/questions/6565357/git-push-requires-username-and-password