[英]Git pull over SSH - Repository not found. HTTPS works
Git pull over ssh does not work for one of private repositories of my organization. Git pull over ssh不适用于我组织的私有存储库之一。
➜ player2-js git:(master) git remote set-url origin git@github.com:MyOrganization/player2-js
➜ player2-js git:(master) GIT_TRACE=1 git pull
11:24:39.494710 git.c:371 trace: built-in: git 'pull'
11:24:39.495491 run-command.c:350 trace: run_command: 'fetch' '--update-head-ok'
11:24:39.495882 exec_cmd.c:116 trace: exec: 'git' 'fetch' '--update-head-ok'
11:24:39.498051 git.c:371 trace: built-in: git 'fetch' '--update-head-ok'
11:24:39.499378 run-command.c:350 trace: run_command: 'ssh' 'git@github.com' 'git-upload-pack '\''MyOrganization/player2-js'\'''
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Url is correct, I copied it from github and double-checked it. 网址是正确的,我从github复制它并仔细检查它。 And, of course my SSH access is correct, I also checked it:
当然,我的SSH访问是正确的,我也检查了它:
➜ player2-js git:(master) ssh -T git@github.com
Hi MyOrganization/academy-ui! You've successfully authenticated, but GitHub does not provide shell access.
I also have no issues with other org's repos where I have same access permissions. 我对其他org的repos没有任何问题,我有相同的访问权限。 Also my colleagues don't have errors with same repo.
我的同事也没有同样的回购错误。 At the same time I'm able to normally load it through:
同时我可以正常加载它:
➜ player2-js git:(master) git remote set-url origin https://besuhoff@github.com/MyOrganization/player2-js
➜ player2-js git:(master) git pull
Password for 'https://besuhoff@github.com':
Already up-to-date.
I've looked through Stack but found only cases where ones either had issues with public key or lacked permissions for repo, both of which are not my cases. 我已经查看了Stack,但发现只有一些情况下公共密钥存在问题或者没有repo权限,这两种情况都不是我的情况。
What can it be? 它能是什么?
UPD. UPD。 Thanks to @Jakuje, I've found out that I was using improper key.
感谢@Jakuje,我发现我使用了不正确的密钥。 For anyone running in the same pretty specific and weird case I'm posting steps to reproduce:
对于任何在同一个非常具体和奇怪的情况下运行的人,我正在发布重现的步骤:
Maybe I'm wrong, but your url does not contain a protocol. 也许我错了,但你的网址不包含协议。 So the default protocol should jump in, that woudl be git://, not ssh://.
所以默认协议应该跳进去,那就是git://,而不是ssh://。
But as I said, I'm not sure about it. 但正如我所说,我不确定。 But's worth a try.
但值得一试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.