When I want to push to github with this command
git push origin master
I got this
Permission denied (publickey).
fatal: The rem
The problem may be related to the order in which the ssh.exe are in the PATH environmental variable.
In my case there was a ssh.exe in both the C:\Program Files(x86)\git and also in my C:\cwgwin directory. When I was in my Git Bash everything worked fine (it was using the ssh in the git directory) but when I was in my Command Prompt it was using the ssh in my cygwin directory.
When I tried to access github it was not able to find the .ssh folder with my private key because the key was not attached to the ssh the command prompt was using (ie the C:\cygwin one) and that is why I was getting the Permission Denied error.
What I did was rename (or delete) the git.exe and ssh.exe in my C:\cygwin directory and make sure that C:\Program Files(x86)\git appears before the C:\cwgwin in the PATH order.
I had similar Prob in win 8.
Very Simple mistake I did: I have already created public key in git hub account so that y keys was not getting match.
Solution:
1) ssh-keygen -t rsa -C "your mail address"
2) ssh -T git@github.com
there could be something wrong with your heroku keys. try:
heroku keys:add
similar question here: Heroku Git - fatal: The remote end hung up unexpectedly