我真的在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成功克隆我的回购?
注意:我正在使用Windows平台。抱歉:|
答案 0 :(得分:3)
谷歌搜索了一下,我发现git从C:\ Users \ user \ .ssh的不同本地读取ssh密钥。 git从C:\ Program Files \ Git \ .ssh
读取ssh密钥因此,将生成的密钥从C:\ Users \ user \ .ssh复制到C:\ Program Files \ Git \ .ssh并将这些密钥添加到heroku
heroku keys:add
它可以使用ssh进行连接。
:)
Here是真正的解决方案。