I'm on Mac Snow Leopard and I just installed git
.
I just tried
git clone git@thechaw.com:cakebook.git
but that gives me this error:
Initialized empty Git repository in `/Users/username/Documents/cakebook/.git/`
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
What am I missing?
I've also tried doing ssh-keygen
with no passphase but still same error.
On Windows, make sure all your apps agree on HOME. Msys will surprisingly NOT do it for you. I had to set an environment variable because ssh and git couldn't seem to agree on where my .ssh directory was.
I was getting this error because I generated the ssh keys with the wrong email. I was able to connect using ssh, but not using git. The solution was to regenerate the keys using the main email address of my github account.
This works for me:
Its pretty straight forward. Type the below command
Generate the SSH key. Open the file and copy the contents. Go to GitHub setting page , and click on SSH key . Click on Add new SSH key, and paste the contents here. That's it :) You shouldn't see the issue again.
I was getting a similar Permission denied (publickey) error when trying to run a makefile.
As an alternative to the SSH steps above, you can Install the native GitHub for Mac application.
Click Download GitHub for Mac from - https://help.github.com/articles/set-up-git#platform-mac
Once you complete setup with your git hub account (I also installed the git hub command line tools but unsure if this step is required or not) then I received an email -
[GitHub] A new public key was added to your account
and my error was fixed.
It worked for me