本文介绍了当我尝试拉入或推送 GitHub 时,我收到一条错误消息:“请改用个人访问令牌."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我通过 SourceTree 使用版本控制作为 GitHub,但从 8 月 13 日起它就失败了,以下是我从 GitHub 得到的错误.
I am using the version control as GitHub through SourceTree, but it is getting failed from 13th August, the below is the error I am getting from GitHub.
remote:8 月 13 日取消了对密码身份验证的支持,2021. 请改用个人访问令牌.远程:请参阅 https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/了解更多信息.
有人知道问题出在哪里,或者我如何使用个人访问令牌?
Anybody know what was the problem, or how can I use the personal access token?
推荐答案
由于 OP 使用 SourceTree,请执行以下操作:
Since the OP is using SourceTree, do the following:
- 在 Github 帐户设置中生成您的个人访问令牌.
- 双击 SourceTree 中的存储库,单击弹出窗口右上角的
Setting
图标. - 在菜单选项卡中单击
Remotes
.你会看到这个仓库的远程 URL,应该是这样的https://github.com/username/repo.git
. - 点击
Edit
并将其更改为https://@github.com/username/repo.git
.
- Generate your Personal access tokens in Github account setting.
- Double click a repository in SourceTree, click
Setting
icon in the top right of the popup window. - Click
Remotes
in the menu tab. You will see the remote URL of this repository, which should be like thishttps://github.com/username/repo.git
. - Click
Edit
and change it tohttps://<your_token>@github.com/username/repo.git
.
完成.
这篇关于当我尝试拉入或推送 GitHub 时,我收到一条错误消息:“请改用个人访问令牌."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!