简体   繁体   English

Git拉过SSH - 找不到存储库。 HTTPS有效

[英]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: 对于任何在同一个非常具体和奇怪的情况下运行的人,我正在发布重现的步骤:

  1. Initial state, everything works throught ssh 初始状态,一切都通过ssh工作
  2. I created a new key file through ssh-keygen, placed it into my .ssh folder 我通过ssh-keygen创建了一个新的密钥文件,将其放入我的.ssh文件夹中
  3. I authorized the newly created key to access one of my repositories 我授权新创建的密钥访问我的一个存储库
  4. My console git client began using this new key when authorizing to git@github.com via ssh (how come? Does ssh-keygen add to ssh-agent or something???) 我的控制台git客户端在通过ssh授权git@github.com时开始使用这个新密钥(为什么?ssh-keygen是否添加到ssh-agent或其他东西?)

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.

相关问题 远程:未找到存储库。 Git pull 显示致命:使用访问令牌时未找到存储库“https://github.com/username/repositoryname.git/” - remote: Repository not found. Git pull shows fatal: repository 'https://github.com/username/repositoryname.git/' not found when using access token 无法通过SSH使用Git for Windows 2.14克隆/拉/推存储库 - Unable to clone/pull/push a repository with Git for Windows 2.14 over SSH Visual Studio-Git克隆无法通过SSH进行故障转移,但可以通过HTTPS进行工作 - Visual Studio - Git clone fails over SSH, but works over HTTPS Github 远程:未找到存储库。 致命:在 Pycharm 中找不到存储库“https://github.com/org/repo.git/” - Github remote: Repository not found. fatal: repository 'https://github.com/org/repo.git/' not found in Pycharm 远程:找不到用于git pull的存储库 - remote: Repository not found for git pull 通过ssh git克隆,推送https - Git clone over ssh, push over https 为什么从github仓库通过https的“ git pull”命令需要“ sudo”作为前缀? - Why “git pull” command over https from github repository need “sudo” as prefix? Git远程:使用ssh设置另一个帐户后,找不到用于https的存储库 - Git remote: Repository not found for https, after setting up for another account with ssh git pull over ssh给出错误 - git pull over ssh gives errors Github 组织“远程:未找到存储库。” 通过 Https 克隆 - Github Organization "remote: Repository not found." via Https Clone
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM