Atom+Git:更改为2FA/PAT后无法推送

  • 本文关键字:PAT 2FA Atom+Git git atom-editor
  • 更新时间 :
  • 英文 :


从今天开始,我不能再使用atom中的git插件来推送提交。错误消息:

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/....my_repo....': The requested URL returned error: 403

我已经为正常登录设置了2FA,并根据错误消息中的请求创建了个人访问令牌。然而,我不清楚将这些新信息存储在哪里。如有任何关于如何解决此问题的帮助,我们将不胜感激!

谢谢!

附加信息:

  • 操作系统:Ubuntu 20.04
  • 原子:1.54.0
  • 电子:6.1.12
  • 铬:76.0.3809.146
  • 节点:12.4.0
  • git:git版本2.25.1

所以我发现了这一点,我想:Atom直接使用git中存储的凭据,在atoms端没有特定的配置文件。

为了解决我的问题,我将远程url更改为ssh(我设置了ssh密钥(,atom立即重新工作。

git remote set-url origin git@github.com:dluecking/my_repo.git

GitHub自2021年8月13日起不支持使用用户/通行证登录的回购操作。我现在已经设置了SSH连接,而不是通过以下命令运行:

1.更改回购中的链接

git remote set-url origin git@bitbucket.org:repo-owner-here/repo-name-here.git

2.生成一个新的SSH密钥&将其添加到ssh代理(MacOS(

请参阅相关GitHub文档

3.将SSH公钥添加到GitHub用户帐户

请参阅相关GitHub文档

4.测试&连接

ssh -T git@github.com

可能返回警告,键入

yes

应该返回

"嗨,你的用户名在这里!您已成功通过身份验证,但GitHub不提供shell访问">

最新更新