我真的在 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/