Git push results in "Authentication Failed"

If you enabled two-factor authentication in your GitHub account you won't be able to push via HTTPS using your accounts password. Instead you need to generate a personal access token. This can be done in the application settings of your GitHub account. Using this token as your password should allow you to push to your remote repository via HTTPS. Use your username as usual.

Creating a personal access token

You may also need to update the origin for your repository if it is set to HTTPS. Do this to switch to SSH:

git remote -v
git remote set-url origin [email protected]:USERNAME/REPONAME.git

On Windows, try the following steps to edit or remove the saved credentials:

  1. Click Start
  2. Type: Credential Manager (on Windows 10, this is under "StartSettings". Then search for "Credential Manager")
  3. See the Windows Credentials Manager shortcut and double-click it to open the application.
  4. Once the application is open, click on the Windows Credentials tab.
  5. Locate the credentials that you want to remove/update. They will start with "git:" and might begin with "ada:"
  6. Click on the credential entry. It will open a details view of the entry.
  7. Click Edit or Remove as required and confirm.
  8. Lather, rinse, repeat as necessary.

Enter image description here


It happens if you change your login or password of git service account (Git). You need to change it in Windows Credentials Manager too. type "Credential Manager" in Windows Search menu open it.

Windows Credentials Manager->Windows Credential and under Generic Credentials edit your git password.


Maybe you have changed the password recently for you Git account. You could try the git push line with the -u option:

git push -u origin branch_name_that_you_want_to_push

After executing the above command, it will ask for a password. Provide your updated password.


On Windows, this worked for me, and it also remembers my credentials:

  1. Run Git Bash

  2. Point to the repository directory

  3. Run git config --global credential.helper wincred