GitHub: Permission denied (publickey). fatal: The remote end hung up unexpectedly

ziiweb picture ziiweb · Sep 1, 2010 · Viewed 315.9k times · Source

I have followed these instructions below to upload a project.

Global setup:

 Download and install Git
  git config --global user.name "Your Name"
  git config --global user.email [email protected]
  Add your public key


Next steps:

  mkdir tirengarfio
  cd tirengarfio
  git init
  touch README
  git add README
  git commit -m 'first commit'
  git remote add origin [email protected]:tirenga/tirenga.git
  git push origin master

But I get this error:

Permission denied (publickey). fatal: The remote end hung up unexpectedly

Answer

ziiweb picture ziiweb · Sep 1, 2010

I had to add my public key to github. https://help.github.com/articles/generating-ssh-keys