George Liu
George Liu

Reputation: 3583

How to resolve unable to push to GitHub due to "Invalid username or password"?

I have been having this issue for a short while. Basically, I was not able to push to a personal repo on GitHub from my work computer using GitBash with https.

Here's the error message

$ git push origin master
Username for 'https://github.com': 
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/georgeliu1998/mlnd.git/'

Checked out these following threads but they don't seem to be the same situation.

Upvotes: 3

Views: 6516

Answers (1)

George Liu
George Liu

Reputation: 3583

It turns out that I need to log in using my username, but instead of using the normal GitHub account password, I should use a personal access token that can be created here.

Edited content by Do Nhu Vy:

Because I am use GitHub feature named "Two-factor authentication" (It isn't a standard Git's feature, it's added feature by GitHub.com). After turn on the feature, I must create "Personal Access Tokens"

Reference

https://help.github.com/articles/about-two-factor-authentication/

https://github.com/settings/tokens

Upvotes: 8

Related Questions