Remote: Invalid username or password. fatal: authentication failed

I am using Git for Windows. I created an SSH key and added it to the key list of my GitHub settings in accordance with this article . Now I try to use it, but I get an error:

$ git push origin master Username for 'https://github.com': Andrey-Bushman Password for 'https:// Andrey-Bushman@github.com ': remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/Andrey-Bushman/sandbox.git/ 

How can i fix this?

+5
source share
1 answer

First, make sure that the ssh keys are successfully created by running the command:

 $ ssh -T git@github.com 

It should print "Hi Andrey-Bushman! You've successfully authenticated, but GitHub does notprovide shell access."

If not, check out SSH Git Access .

After completing, do the following:

  • clone repo using ssh protocol like:

    git@github.com :<github-username>/<repo>.git

    In your case:

    git@github.com :Andrey-Bushman/<repo>.git

  • Commit your changes to the repo.

  • Then git push origin <branch-name>

    In your case:

    git push origin master

+3
source

All Articles