git - 如何解决由于 "Invalid username or password"而无法推送到 GitHub?

标签 git github

我遇到这个问题已经有一段时间了。基本上,我无法使用带有 https 的 GitBash 从我的工作计算机推送到 GitHub 上的个人存储库。

这是错误信息

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

检查了以下这些线程,但它们似乎不是相同的情况。

最佳答案

事实证明,我需要使用我的用户名登录,但我应该使用可以创建的个人访问 token 而不是使用普通的 GitHub 帐户密码 here .

Do Nhu Vy 编辑的内容:

因为我正在使用名为“双因素身份验证”的 GitHub 功能(这不是标准的 Git 功能,它是由 GitHub.com 添加的功能)。开启该功能后,我必须创建“个人访问 token ”

引用

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

https://github.com/settings/tokens

关于git - 如何解决由于 "Invalid username or password"而无法推送到 GitHub?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42163501/

相关文章:

git - Visual Studio Code 是否有类似 IntelliJ 的功能 "Compare with branch"

laravel - 从正在运行的项目的 Git 中提取更新

ios - merge 两个 git 仓库(不小心从 github 下载的 .zip,需要重新 merge 进去)

git - 有没有办法以编程方式获取私有(private) github repo 的 zipball?

GitHub 登录和企业 URL 问题

git - Docker镜像git clone错误 “fatal: Not a git repository”

windows - Git Windows 安装程序不允许我选择安装位置

python - 为什么 pip install -e git-repo 在第二次调用时将 HEAD 更改为 master

git - 有了 CI 服务器就一定要在本地跑测试吗?

git - Tomcat/Hudson 无法连接到 Github