permission denied (publickey) Error using git on windows 7

Viewed 103283

When I want to push to github with this command

git push origin master

I got this

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

So, what's wrong?

16 Answers

Have you generated an SSH key for yourself and added it to your Github account? They have a guide for this here.

This is a very common problem and all beginners face this issue. Here is how to resolve the problem.

  1. Open gitbash

  2. Update your email address in below command.

    ssh-keygen -t ed25519 -C "your_email@example.com"

  3. Then copy your ssh key to clipboard with below command.

    clip < ~/.ssh/id_ed25519.pub

  4. Open your git account from the browser. goto settings -> ssh and gpg keys -> click on "New ssh key" add name and key in the text box then press save and git will ask you to enter your account password please enter that and your ssh key will be configured.

That's it it should resolve your problem if not then please do let me know. I'll help you troubleshoot the issue.

Peace.

Related