Skip to content

Instantly share code, notes, and snippets.

@imabuddha
Created January 23, 2021 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imabuddha/e3e40f8df6b292fd8b2df9c3105b71e9 to your computer and use it in GitHub Desktop.
Save imabuddha/e3e40f8df6b292fd8b2df9c3105b71e9 to your computer and use it in GitHub Desktop.

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.

https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/

You may also need to update the origin for your repository if set to https:

git remote -v 
git remote remove origin 
git remote add origin git@github.com:user/repo.git  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment