如何解决由于“无效的用户名或密码"而无法推送到GitHub的问题? [英] How to resolve unable to push to GitHub due to "Invalid username or password"?
问题描述
我已经有短时间了这个问题.基本上,我无法使用带有https的GitBash从工作计算机上推送到GitHub上的个人存储库.
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.
这是错误消息
$ 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.
- git invalid username or password
- GitHub authentication failing over https, returning wrong email address
推荐答案
事实证明,我需要使用用户名登录,但与其使用普通的GitHub帐户密码,不如使用我的个人访问令牌,在此处中创建.
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.
因为我正在使用名为双重身份验证"的GitHub功能(这不是标准的Git功能,它是GitHub.com新增的功能).启用该功能后,我必须创建个人访问令牌"
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"
参考
https://help.github.com/articles/about-双重身份验证/
https://github.com/settings/tokens
这篇关于如何解决由于“无效的用户名或密码"而无法推送到GitHub的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!