【问题标题】:Command line git commands suddenly asking for password命令行 git 命令突然要求输入密码
【发布时间】:2022-01-08 14:04:47
【问题描述】:

在过去的三周里,我一直在使用 OSX 钥匙串来管理我的 GitHub 凭据。每当我需要更新时,我都会照常进行:

git pull origin master

使用此命令,钥匙串会弹出并请求我输入的密码,然后执行在命令行中输入的命令。

今天早上,我突然进行了另一项更改,现在它在命令行中询问我的用户名和密码。然后我得到通常的错误:

remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.

我已经为此工作了一段时间,但不明白为什么其他问题中的方法不起作用。我没有运气就关注了这些其他帖子

osxkeychain

update git

credential helper and ssh-add -L answers

【问题讨论】:

  • 当被要求输入密码时,您需要使用个人访问令牌而不是密码。
  • @bk2204 谢谢,是用“密码”这个词代替了“个人访问令牌”让我失望了!

标签: git macos macos-monterey


【解决方案1】:

首先,这与 ssh-add 无关,用于缓存 SSH 私钥密码

其次,这与GitHub new policy: Git password authentication is shutting down有关。

您需要使用PAT (Personal Access Token) 而不是您的 GitHub 帐户密码,如 Antonello Zaninidescribed here 的“Dealing With GitHub Password Authentication Deprecation”中所述。

【讨论】:

  • 非常感谢!我认为分离其中一些概念是有帮助的。如果其他人偶然发现这一点,当命令行询问您的密码时,您会提供个人访问令牌,正如 VonC 所说。名称密码/PAT 的重叠让我大吃一惊。
猜你喜欢
  • 2013-11-24
  • 2010-12-19
  • 2014-10-05
  • 1970-01-01
  • 2013-07-22
  • 1970-01-01
  • 2023-03-25
  • 2012-11-08
  • 2013-09-30
相关资源
最近更新 更多