I run git push -u origin master
It tells me that "Permission denied (public key) fatal: The remote end hung up unexpectedly"
Then I looked up on the internet and found that I had to generate an ssh key for my account on GitHub. However, upon doing so, when I tried to do ssh-keygen -t rsa "email@youremail.com" it simply said ssh-keygen is not recognized. I tried doing mkdir C:\ssh but that didn't work. If it helps I'm using Ruby Rails and I'm on a Windows computer. Could anyone help me?
for those who does not choose BASH HERE option. type sh in cmd then they should have ssh-keygen.exe accessible
No need to add anything to environmental variables! Just open up git bash and perform command the ssh-keygen in there.
Link to download git bash here
Just go to heroku.bat and add:
@SET PATH="D:\Program Files (x86)\Git\bin";%PATH%
after@SET PATH=%HEROKU_RUBY%;%PATH%
in my case it's in D:\Program Files (x86)\Git\bin, change it to the path you've installed Git to. (i just left it with my path so it will be clearer on how to write this)
2012:
ssh-keygen.exe
is part of msysgit:if your
%PATH%
includesC:\path\to\msysgit1.7.11\bin\
, you will havessh-keygen
.Update 2015:
ssh-keygen.exe
is part of Git For Windows, whose releases include PortableGit-2.4.3.1-2nd-release-candidate-64-bit.7zThat means the
%PATH%
must includec:\path\to\PortableGit-2.4.3.1-2nd-release-candidate-64-bit\usr\bin
(without thessh-keygen.exe
)As I explained before, Git for Windows will soon phase out msysgit.
I detailed in "Why is it that if you download Git 2.0 from the net, you always get a 1.9.4 installer package?" how this new version is based on the more recent msys2 project.
For windows you can add this:
I got it fixed by just adding
ssh-keygen
to my environment variables.