主要问题
:
vscode的terminal上面推送代码到不同账号,要么重新登录vscode的账号,这样很麻烦,在ubuntu的terminal终端推送代码,需要输入用户名和密码,但是github使用authentication app鉴权后没法输入密码登录github了,在用git push的时候登录不上。
报错像下面这样
:
remote: Support for password authentication was removed on August 13, 2021. remote: Please
see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls
for information on currently recommended modes of authentication. fatal: 'https://github.com/XXXX/X_code.git/' 鉴权失败
解决方式
从2021年8月13日开始,GitHub不再支持使用密码进行身份验证。你需要使用个人访问令牌(PAT)或SSH密钥进行身份验证。
以下是如何创建和使用个人访问令牌的步骤:
- 登录到你的GitHub账户。
- 点击右上角的头像,然后选择"Settings"。
- 在左侧的菜单中,选择"Developer settings"。
- 在左侧的菜单中,选择"Personal access tokens"。
- 点击"Generate new token