github.com:权限被拒绝(公钥)

github.com:权限被拒绝(公钥),git,github,Git,Github,我试图将本地存储库中的代码推送到github,但我被困在这里: $ git push origin master git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 问题可能出在您的.git/config

我试图将本地存储库中的代码推送到github,但我被困在这里:

$ git push origin master
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

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

问题可能出在您的.git/config文件中,因此在我的例子中,我删除了.git文件以重新初始化它,并按照流程的其余部分将代码推送到远程存储库,这次成功了。

检查此项:这是否回答了您的问题?