今天用sourcetree拉取代码的时候报错:
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: unable to access 'https://github.com/shliang0603/Yolov4_DeepSocial.git/': The requested URL returned error: 403
通过查看网站https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information,得知原先的密码凭证从2021年8月13日
开始就不能用了,必须使用个人访问令牌(personal access token)
,也就是说,要把个人密码
替换成token。
那么首先,需要在GitHub上创建token。
参考:https://blog.csdn.net/weixin_41010198/article/details/119698015
接下来就是修改密码。
打开mac电脑的钥匙串访问,图标大概是这个样子:
打开它,在右上角的搜索栏搜索git,如下图所示:
双击Github Credentials,如下图所示:
显示密码之后,将access_token=后面的内容删掉,改为刚刚创建好的personal access token即可。
然后再重新拉取代码。
如果有问题,在sourcetree的设置里打开远程仓库,如下图所示:
点击编辑配置文件,查看里面的链接是否正确。