Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remote: Invalid username or password. fatal: Authentication failed for

Tags:

git

github

I use Git for Windows. I created SSH key and added it into the keys list of my GitHub settings according this article. Now I try to use it, but I get the error:

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

How can I fix it?

like image 684
Andrey Bushman Avatar asked Oct 19 '22 02:10

Andrey Bushman


1 Answers

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

$ ssh -T [email protected]

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

If not, then refer to SSH Access to Git.

Once done follow the steps below:

  1. clone the repo using ssh protocol as:

    [email protected]:<github-username>/<repo>.git

    In your case:

    [email protected]:Andrey-Bushman/<repo>.git

  2. Commit your changes to the repo.

  3. Then, git push origin <branch-name>

    In your case:

    git push origin master

like image 182
Arpit Aggarwal Avatar answered Oct 21 '22 15:10

Arpit Aggarwal