git - 权限被拒绝(公钥)。 heroku git :clone myapp - on Windows

标签 git heroku ssh

我真的在 Stack 和 web 上进行了详尽的搜索,但没有找到解决这个问题的方法。

我只想将我的 repo 从 heroku git 克隆到我的工作机器上,并执行以下操作:

heroku git:clone myapp

或者
git clone git@heroku.com:myapp.git -o heroku

两者的输出相同:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.

好的,我已经读过这意味着在机器上找不到 ssh 公钥。
我添加了许多不同方式的键,例如:
ssh-keygen -t rsa -f id_rsa

或者
heroku keys:clear
heroku keys:add

或者
ssh-keygen -t rsa -C "my_email[at].com" -f C:\path\.ssh\id_rsa_heroku

有人可以解释一下发生了什么吗?

还有另一种方法,或者我错过了一些步骤来设置从 git 克隆我的 repo 成功?

注意:我在 Windows 平台上。对此感到抱歉:|

最佳答案

谷歌搜索了一下,我发现 git 从 C:\Users\user\.ssh 的不同本地读取 ssh key 。 git 从 C:\Program Files\Git\.ssh 读取 ssh key

因此,将生成的 key 从 C:\Users\user\.ssh 复制到 C:\Program Files\Git\.ssh 并将这些 key 添加到 heroku

heroku keys:add

它将能够使用 ssh 进行连接。

:)

Here是真正的解决方案。

关于git - 权限被拒绝(公钥)。 heroku git :clone myapp - on Windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20147312/

相关文章:

git - 我真的需要在 .gitattributes 中指定所有二进制文件吗

django - Heroku Django Postgresql 数据库管理员, super 用户在哪里?

heroku - Sinatra config.ru 加载错误

git - 具有 ssh 访问 bitbucket : Permission denied (publickey). fatal error 的 Jenkins git 插件:无法从远程存储库读取

git - 您可以使用 git merge 并推送另一个分支吗?

git - 使用vue项目部署到github页面的问题

git - 不能在代理后面做 git-svn fetch

mysql - 在 Rails 5 上制作 postgres 数据库,以便将应用程序部署到 heroku

ssh - Vagrant 拒绝许可

ssh - 当 ssh 连接到另一台计算机时我是谁