Username for 'https://github.com': username
Password for 'https://username@github.com':
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: Authentication failed for 'https://github.com/username/repo.git/'
尽管使用了个人访问 token ,但我仍然收到此错误,并且它已经正常工作了大约 6 个月,没有过期日期。
但现在我试图在我的 vps 上进行一些更改,但出现了这个错误。
我已经创建了一个新的访问 token ,但仍然出现相同的错误。
我该如何解决这个问题?
最佳答案
通过在推送或 pull 某些东西之前设置原始 url 来解决问题,就像这样:
~$ git remote set-url origin https://<githubtoken>@github.com/<username>/<repositoryname>.git
~$ git pull origin <branch>
正如此处所说 “Support for password authentication removed” for GitHub. How to Generate Personal Access Token?
关于git - 请改用个人访问 token 。 (但使用一个),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71517236/