无法克隆git repo

时间:2014-03-06 14:06:46

标签: git heroku ssh rsa

我正在尝试在heroku上托管的项目上进行合作。我已经被meldium.com邀请,我已经成功注册了我的电子邮件地址。

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

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

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

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

我做错了什么?

非常感谢

1 个答案:

答案 0 :(得分: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域的密钥。

相关问题