Support for password authentication was removed on August 13, 2021

Support for password authentication was removed on August 13, 2021

在使用 Git 上传将本地仓库推送到远程服务器时,出现了以下问题:

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.
fatal: 无法访问 'https://github.com/LiuXianghai-coder/Study.git/':The requested URL returned error: 403

大概意思就是自 2021年 8 月 13日开始,Github 中通过 用户名 + 密码的认证方式被移除了,只能通过个人访问码的方式进行认证。

  1. 首先,需要创建个人访问码,即它提示的 Personla access token
     首先,进入 Github 主界面:
    Support for password authentication was removed on August 13, 2021_第1张图片

    选择 “Seeting”,进入设置界面:
    Support for password authentication was removed on August 13, 2021_第2张图片
    在左边的导航栏目里面选择 “Developer seetings”,进入开发者设置页面
    Support for password authentication was removed on August 13, 2021_第3张图片
    选择 “Personal access tokens”, 点击 “Generate new token”:
    Support for password authentication was removed on August 13, 2021_第4张图片
    你会看到如下界面:
    Support for password authentication was removed on August 13, 2021_第5张图片
     输入 “note”,选择 “Expiration(有效期)”,你可以自定义有效时间。下面的复选框没有特别的要求的话可以都勾上, 然后到页面最下面,点击“Generate Token”,产生对应的个人访问码。
    Support for password authentication was removed on August 13, 2021_第6张图片
     现在你可以看到产生的个人访问码了,复制它,然后将它保存到一个文件里。
    Support for password authentication was removed on August 13, 2021_第7张图片

  2. 使用 Personal access token 进行身份验证
     再次执行推送命令,这时会提示输入用户名,按照正常的输入即可;在输入用户名之后将会提示输入密码,这里就需要输入之前产生的个人访问码(Personal access token)了,直接复制输入即可。
     之后你就会发现可以推送本地仓库了。

你可能感兴趣的:(开发工具,git,github)