GitHub - Personal Access Token 以及修改SourceTree中存储的密码
由于8月13日之后,Github的密码需要由GitHub的密码,更换为私人访问令牌,即Personal Access Token,导致无法使用。推送报错:
Pushing to https://github.com/xxx/xxxxxx.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: unable to access 'https://github.com/xxx/xxxxxx.git/': The requested URL returned error: 403
关于Personal Access Token的申请方式参考:https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/
可以申请永久令牌,令牌是一次性的,注意保存
之后,需要更新SourceTree的账号和秘密,参考Sourcetree change password of existing account,需要删除已保持的密码,才能生成新的密码。
具体位置:
/Users/xxxx/Library/Application Support/SourceTree
删除全部含有“@”的文件,当再次推送push时,就会要求输入密码,替换输入令牌即可,完成推送。