git push: permission denied (public key)
问题 I'm trying to push a file to a git repo of a friend but errors on public key. git push origin testbranch Permission denied (publickey). fatal: Could not read from remote repository. Where and how do we define public / private keys? git remote -v returns: origin git@github.com:Sesamzaad/NET.git (fetch) origin git@github.com:Sesamzaad/NET.git (push) Any help is appreciated. 回答1: I was facing same problem, here is what I did that worked for me. Use ssh instead of http. Remove origin if its http.