【问题标题】:git push trying to push to a Wrong remote origin?git push 试图推送到错误的远程源?
【发布时间】:2013-03-07 00:19:04
【问题描述】:

早安,

我有一个非常奇怪的问题,有人在 github 中将我添加为他组织的成员,并要求我提供 rsa 密钥,我现在是该组织的成员,但现在我的所有其他项目在进行推送时指向该组织的回购,即:

for_linode $ git push origin master
ERROR: Permission to jlstr/for_linode.git denied to other_org/core.
fatal: Could not read from remote repository.

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

当我打印我的远程源配置时,它会显示正确的信息:

for_linode $ git remote show origin
* remote origin
  Fetch URL: git@github.com:jlstr/for_linode.git
  Push  URL: git@github.com:jlstr/for_linode.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (fast-forwardable)

为什么要推送到 other_org/core 存储库?我从来没有见过像这样奇怪的事情,我真的希望有人能帮助我解决这个奇怪的问题.. :(

提前致谢,

何塞。

编辑:

for_linode $ git remote -v
origin  git@github.com:jlstr/for_linode.git (fetch)
origin  git@github.com:jlstr/for_linode.git (push)

编辑:

for_linode $ ssh -T git@github.com
Hi new_org/core! You've successfully authenticated, but GitHub does not provide shell access.

【问题讨论】:

  • git remote -v 返回什么?
  • @iberbeu 您好,感谢您的回复,我已将该命令的结果作为编辑添加到原始问题中。
  • 他们为什么要 rsa 密钥?您只需将您的 github 用户添加到组织中即可。
  • 嗯,密钥也是用来访问VPS服务器的。虽然这是真的,但我假设他将我生成的公钥添加到 github Repo 以授予我推/拉权限。不过不确定是否需要。

标签: git github ssh-keys


【解决方案1】:

试试看

ssh -T git@github.com

它应该打印回您的用户名。

您不应该将 rsa 密钥 ( public ) 提供给其他人以将您添加到组织中。他们所要做的就是将您的 github 用户添加到组织中,该用户当然会与您的密钥相关联。要求将您的密钥从添加的位置删除,或生成一个新密钥对。

【讨论】:

  • 您好!该命令的结果现在粘贴在问题的底部。该命令是从我不想推送到的回购协议中回复的(给了 rsa 密钥的那个)。我一头雾水,这是什么意思?如何解决我当前的问题? - 感谢您的回答。
  • @JoseE - 修复在我的回答中。
  • 好的,我会将此信息传递给组织所有者,然后告诉您结果。再次感谢!
  • 是的,这确实解决了问题,在回购所有者从回购中删除密钥后,我将推送重新发送到不同的回购;它开始起作用了。但是,我想知道是否有什么我必须做的才能推动麻烦的回购(other_org/core)? GitHub 声明:“要解决这个问题,请从 repo 中删除部署密钥并将密钥附加到您的用户帐户”,第一部分已完成,我现在必须将密钥附加到我的用户帐户吗?
猜你喜欢
  • 2013-03-28
  • 2013-04-08
  • 2015-11-05
  • 2015-10-16
  • 2012-08-26
  • 2021-11-28
  • 2012-08-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多