我使用用户名密码来推送我的代码。它工作了几个月,但突然我不能这样做,并得到这个错误:
Username for 'https://github.com': shreyas-jadhav
Password for 'https://shreyas-jadhav@github.com':
remote: Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead.
remote: Please see https://github.blog/2020-07-30-token-authentication-requirements-for-api-and-git-operations/ for more information.
请注意,这个链接没有任何帮助。即使使用生成的令牌也无济于事。
主持人注:这是GitHub计划的一部分,很快将是永久的服务变化
Ubuntu服务器和现有Git存储库的解决方案
删除密码:
git config --global --unset user.password;
git config --local --unset user.password;
改变remote.origin.url。用你的GitHub用户名替换<用户名>:
git config --global --replace-all remote.origin.url "https://<username>@github.com/PPEProjects/smile-eyes-be.git";
git config --local --replace-all remote.origin.url "https://<username>@github.com/PPEProjects/smile-eyes-be.git"
拉/ push
git pull
git push origin HEAD:develop
输入从个人访问令牌生成的个人访问令牌。
您可以通过GitHub仪表板生成您的PAT(个人访问令牌)。
Step 1: Log in to your GitHub account.
Step 2: In the upper-right corner of any page, click your profile photo, then click Settings.
Step 3: In the left sidebar, click Developer settings.
Step 4: In the left sidebar, click Personal access tokens.
Step 5: Click Generate new token.
Step 6: Give your token a descriptive name.
Step 7: Select the scopes, or permissions. You'd like to grant this token. To use your token to access repositories from the command line,
select repo.
Step 8: Click Generate token.
复制您的令牌到一个安全的位置,因为一旦您离开该页面,您将无法检索它,除非您创建一个新的。