I have been stucked a while on the same problem, which I eventually resolved.
My problem: I could not execute any push. I could check & see my remote (using git remote -v
), but when I executed git push origin master
, it returned : Permission denied (publickey). fatal: Could not read from remote repository.
and so.
How I solved it :
ssh-keygen -t rsa
. Entering a name for the key file (when asked) was useless.ssh-add /Users/federico/.ssh/id_rsa
, which successfully returned Identity added: /Users/myname/.ssh/id_rsa (/Users/myname/.ssh/id_rsa)
ssh-add -l
command worked / seemed useful (after having ran the previous steps), it successfully returned my key. The last step shows you where to check your public key on your GitHub page. And this command will help you check all your keys : ls -al ~/.ssh
.Then the push command eventually worked !
I hope this will help ! Best luck to all.