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

473    Asked by AlisonKelly in Devops , Asked on Jun 15, 2021

 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

Answered by Amit raj

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.



Your Answer

Interviews

Parent Categories