经常出现此错误,但常用方法不能解决此问题:GIT push: permission denied (public key) 。
此修复程序对我没有帮助。我能够做到:
ssh -T git@github.com
...完全没有问题。
git remote -v
...还返回带有SSH模式的正确URL。
这是我第三次尝试链接到GitHub页面,所以我不确定为什么现在才遇到此问题。有没有可能我被github页面的主机拒绝访问?难道是他们的错?
我能够从该分支中提取并合并,但是当我尝试推送合并冲突以及代码的某些更新时,我现在收到错误消息(在为我的ssh密钥输入密码后):>
Enter passphrase for key '~/.ssh/id_rsa':
ERROR: Permission to <path>.git denied to <UserName>.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
也许我的用户名错误?我尝试将其设置为我的github名称以及被拒绝的返回名称。
感谢您的任何帮助!
答案 0 :(得分:1)
我认为您根本无权写入此存储库。
例如:
$ git clone git@github.com:freeCodeCamp/freeCodeCamp.git
Cloning into 'freeCodeCamp'...
remote: Enumerating objects: 113, done.
remote: Counting objects: 100% (113/113), done.
remote: Compressing objects: 100% (77/77), done.
remote: Total 96160 (delta 46), reused 81 (delta 36), pack-reused 96047
Receiving objects: 100% (96160/96160), 63.21 MiB | 1.58 MiB/s, done.
Resolving deltas: 100% (57205/57205), done.
Checking connectivity... done.
$ cd freeCodeCamp
$ git checkout -b push-test
Switched to a new branch 'push-test'
$ touch push-test
$ git add push-test
$ git commit -m push-test
[push-test 0916790] push-test
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 push-test
$ git push origin push-test
ERROR: Permission to freeCodeCamp/freeCodeCamp.git denied to msbit.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
正如@ tim-biegeleisen指出的那样,您必须与存储库所有者(可能是您自己?)进行交谈,并让他们允许您的用户访问。这将是ssh -T git@github.com
输出中提到的内容。