git 密码身份验证的源代码树修复作为断电的一部分被暂时禁用。请改用个人访问令牌

Source tree fix for git Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead

仅供参考,这是专门针对 sourcetree 的 我拉sourcetree的时候出现这个错误,昨天还好好的,突然就出现这个错误

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fetch origin
remote: Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead.
remote: Please see https://github.blog/2020-07-30-token-authentication-requirements-for-api-and-git-operations/ for more information.
fatal: unable to access 'https://github.com/London-Foster/frontend.git/': The requested URL returned error: 403

我尝试使用个人访问令牌并在源代码树上使用它,但仍然无法登录。

如果在 Windows,打开凭据管理器并删除您的 github 凭据(如果有的话)。

如果在 macOS 上,请打开钥匙串访问应用程序并删除您的 github 凭据(如果有)。

然后,按照此处的指南获取个人访问令牌https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

然后正常推送您的代码,并在询问时输入您新生成的个人访问令牌。

我已经解决了这个问题,只是为了补充woland的评论。

首先添加个人访问令牌,然后将其添加到您的凭据中 其次通过单击齿轮设置添加遥控器然后添加遥控器 添加您的存储库的远程,然后 link 使用您已记录个人访问令牌的帐户。 最后获取到那个远程源。

1 - 从 git dev settings

生成新令牌

2 - 在 SourceTree 中,您只需更改那里的存储库设置:

3 - 将 URL/Path 更改为新格式:

https://<USERNAME>:<TOKEN>@<GIT_URL>.git

4 - 按确定,现在好了!

我去了: 工具>选项>身份验证。编辑了我的帐户。

我将 AuthenticationBasic 更改为 OAuth。现在断电不再影响我了。

逐步使用终端和github

  1. 删除代码库
git remote remove origin
  1. 生成个人访问令牌 https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

  2. 使用个人访问令牌添加远程备份

记得用您的凭据替换 <personal-access-token><my-repo>

git remote add origin https://<personal-access-token>@github.com/<my-repo>.git>

在 Sourcetree 菜单 -> 首选项 -> 帐户中设置我的 PAT 和帐户后,我仍然遇到断电错误。 在 SourceTree 中添加您的帐户似乎在打开时提示输入密码。

我设置 git 来缓存我的凭据: https://docs.github.com/en/get-started/getting-started-with-git/caching-your-github-credentials-in-git

然后在 SourceTree 中我重新克隆了我的 repo。提示输入密码 - 输入我的 PAT。现在一切正常。

在源代码树 > 打开回购设置 > 远程选项卡 > 将远程“URL/path”编辑为

https://{personal-access-token>@github.com}/{<my-repo>}.git>

然后保存并尝试推送

我喜欢@heratyian 的回答并且工作正常。