Reputation: 155
I really do a exhaustive search here on Stack and web and not found a solution to this problem.
I just want to clone my repo from heroku git to my work machine, and doing:
heroku git:clone myapp
or
git clone [email protected]:myapp.git -o heroku
the output is the same for both:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Ok, I have read that this means was not found a ssh public keys on machine. I added a lot of keys doing from different ways, like:
ssh-keygen -t rsa -f id_rsa
or
heroku keys:clear
heroku keys:add
or
ssh-keygen -t rsa -C "my_email[at].com" -f C:\path\.ssh\id_rsa_heroku
Can someone explain me what is happening?
There is another way or I missing some step to set up to clone my repo from git successful?
Note: I'm on Windows plataform. Sorry about that :|
Upvotes: 1
Views: 2103
Reputation: 155
Googling a little more, I found that the git read the ssh keys from a different local of C:\Users\user\.ssh. The git read the ssh keys from C:\Program Files\Git\.ssh
So, copying the generated keys from C:\Users\user\.ssh to C:\Program Files\Git\.ssh and adding theses keys to heroku
heroku keys:add
it will be able to connecting using ssh.
:)
Here is the real solution.
Upvotes: 3