【问题标题】:Please make sure you have the correct access right and the repository exists github请确保您具有正确的访问权限并且存储库存在 github
【发布时间】:2018-07-05 01:48:33
【问题描述】:

当我尝试将更改推送到我的 github 存储库时,我收到错误消息:

致命:“git@github.comRedHoodJT1988/hello_app.git”似乎不是 git 存储库 致命:无法从远程存储库中读取。

请确保您具有正确的访问权限并且存储库存在。

我已经查看了文档并在此处完成了步骤:https://help.github.com/articles/error-permission-denied-publickey/

以及查看其他网站,没有任何工作。我能够连接到 ssh,因为我收到消息:Hi RedHoodJT1988...

我不知道下一步该做什么。如果有帮助,我没有使用云 IDE,我使用的是 macbook pro。另外,不确定是否重要,我正在开发一个 Ruby on Rails 应用程序。

【问题讨论】:

  • 不应该是你的 ssh 克隆链接会像 git@github.com:RedHoodJT1988/hello_app.git 而不是 git@github.comRedHoodJT1988/hello_app.git
  • git remote -v 返回什么?
  • 显示来源 git@github.comRedHoodJT1988/hello_app.git (fetch)
  • 起源 git@github.comRedHoodJT1988/hello_app (push)
  • 您缺少冒号。我将在下面添加一个解决方案。

标签: ruby-on-rails git github ssh


【解决方案1】:

您的地址中缺少冒号,需要更改远程命名来源

git remote remove origin
git remote add origin https://github.com/RedHoodJT1988/hello_app.git

【讨论】:

  • 所以我现在得到一个不同的错误 ssh: 无法解析主机名 github.com:redhoodjt1988: nodename nor servname provided, or not known fatal: 无法从远程存储库读取。请确保您拥有正确的访问权限并且存储库存在。
  • 您可以尝试使用 https url 读取遥控器吗? https://github.com/RedHoodJT1988/hello_app.git 所以git remote remove origin git remote add origin https://github.com/RedHoodJT1988/hello_app.git
  • 当我运行 git remote -v 它会产生结果 origin github.com:RedHoodJT1988/hello_app.git (fetch) origin git@github.com:RedHoodJT1988/hello_app.git.gitRedHoodJT1988/hello_app.git (push)跨度>
  • 你是从git remote -v得到的,是在把遥控器改成使用https地址之后吗?
  • 有没有办法解决这个问题?我知道这不可能。
【解决方案2】:

既然是SSH URL,就不应该涉及任何https:

 git remote set-url origin git@github.com:RedHoodJT1988/hello_app.git

【讨论】:

    猜你喜欢
    • 2013-07-15
    • 2018-08-05
    • 2014-11-13
    • 1970-01-01
    • 2021-04-18
    • 2015-07-16
    • 1970-01-01
    • 1970-01-01
    • 2021-12-07
    相关资源
    最近更新 更多