Permission denied (publickey). fatal: The remote end hung up unexpectedly
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 chandra@gmail.com
Add your public key
Next steps:
mkdir chandrarfio
cd chandrarfio
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@github.com:chandra/devops.git
git push origin master
But I get this error:
Permission denied (publickey). fatal: The remote end hung up unexpectedly
For permission denied publickey fatal the remote end hung up unexpectedly, if you have the user permission then it works fine but if you don’t have the user permission then you need to add an ssh key to github:
For adding an ssh key to github refer: https://help.github.com/en/articles/adding-a-new-ssh-key-to-your-github-account
Then after configuring that your code runs fine without any error.