Heroku 项目的 git 克隆失败

发布于 2024-12-02 23:50:37 字数 840 浏览 3 评论 0原文

(在苹果机上) 我正在尝试从我的新计算机克隆我的项目。我首先生成了 ssh 密钥对:

heroku keys:add /Users/y/.ssh/heroku_rsa.pub

heroku keys 显示:

ssh-rsa AAAAB3NzaC...B9DjpXg3fb [email protected]

当我尝试通过 git clone [电子邮件受保护]:xyz.git

Cloning into xyz...
Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

这很奇怪。

编辑:如果我不重命名我的公钥文件,那么它就可以工作。不知何故,heroku 不喜欢重命名我的密钥。换句话说,使用默认的 id_rsa.pub 名称。

(on Mac)
I'm trying to clone my project from my new computer. I first generated the ssh key pairs:

heroku keys:add /Users/y/.ssh/heroku_rsa.pub

heroku keys shows:

ssh-rsa AAAAB3NzaC...B9DjpXg3fb [email protected]

When I try to clone my project by git clone [email protected]:xyz.git

Cloning into xyz...
Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

This is strange.

EDIT: If I don't rename my pub key file then it works. Somehow heroku doesn't like renaming my keys.. in other words, use the deault id_rsa.pub name.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

会发光的星星闪亮亮i 2024-12-09 23:50:37

我有类似的问题。起初,我没有名为 id_rsa.pub 的密钥。我只有 github 的密钥:github_rsa.pub。我运行了 Heroku Keys 并发现它确实识别出了我有一把钥匙。但显然 Heroku 不喜欢那个 github 密钥。这就是我所做的:

$ssh-keygen -t rsa
$heroku keys:clear
$heroku keys:add 
$git clone [email protected]:my-app.git -o heroku

这成功下载了该项目的所有文件。

I had a similar problem. At first, I did not have a key called id_rsa.pub. I only had a key for github: github_rsa.pub. I ran heroku keys and saw that it did recognize that I had a key. But apparently heroku does not like that github key. Here's what I did:

$ssh-keygen -t rsa
$heroku keys:clear
$heroku keys:add 
$git clone [email protected]:my-app.git -o heroku

This downloaded all the files for the project successfully.

伴随着你 2024-12-09 23:50:37

您的密钥似乎未加载。默认情况下仅加载默认命名密钥(id_rsa)。使用 ssh-add 命令加载 heroku 密钥:

ssh-add ~/.ssh/heroku_rsa

It looks like your key is not loaded. Only default named key (id_rsa) loaded by default. Load the heroku key by using ssh-add command:

ssh-add ~/.ssh/heroku_rsa
娇柔作态 2024-12-09 23:50:37
heroku git:clone -a "your_project_name_on_heroku"

这个简单的命令可以正常工作(前提是您的 ssh 密钥之前已正确添加)

heroku git:clone -a "your_project_name_on_heroku"

This simple command works fine (provided that your ssh key is correctly added before)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文