【问题标题】:Cannot clone git repo无法克隆 git repo
【发布时间】:2014-03-06 14:06:46
【问题描述】:

我正在尝试在 heroku 上托管的项目上进行合作。我已通过 meldium.com 获得邀请,并且我已成功将我的电子邮件地址注册到该项目。

我收到了来自 heroku 的电子邮件,说我可以使用以下命令行克隆 repo:

$ git clone git@heroku.com:test-repo.git -o heroku

但每次我尝试克隆 repo 时都会收到以下错误消息:

Warning: Permanently added the RSA host key for IP address 'XX.XX.XX.XXX' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

我不明白的是,我收到一封电子邮件,说我的帐户已添加一个密钥,当我输入 heroku key 时,我得到了这个:

ssh-rsa AAAAB3NzaC...lhJB2r8hnD my-github-id@github.com

我做错了什么?

非常感谢

【问题讨论】:

    标签: git heroku ssh rsa


    【解决方案1】:

    如果您收到公钥错误消息,通常是因为您提供的 ssh 密钥与 Heroku 拥有的密钥不匹配。

    从你的命令行执行 ssh -v git@heroku.com 你在这里寻找一些看起来像

    debug1: Next authentication method: publickey
    debug1: Offering RSA public key: /Users/foobah/.ssh/id_rsa
    debug1: Server accepts key: pkalg ssh-rsa blen 277
    debug1: Authentication succeeded (publickey).
    

    如果密钥的名称与您添加到 Heroku 的公钥不对应,那么您需要将相应的密钥添加到 Heroku 或切换 ssh 用于 heroku.com 域的密钥。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-07
      • 2022-11-02
      相关资源
      最近更新 更多