3

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.

Community
  • 1
  • 1
George Liu
  • 3,601
  • 10
  • 43
  • 69

1 Answers1

7

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

George Liu
  • 3,601
  • 10
  • 43
  • 69
  • There's also https://developer.github.com/v3/auth/#working-with-two-factor-authentication which says you can actually use an OTP but recommends using the token instead. – Josh Lee Feb 10 '17 at 16:32