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.
解决方法
Token 登录
若之前记住了密码,则需要删除用户目录下的 .git-credentials
文件,则可以重新输入用户名和密码,输入密码时输入 Github 生成的 Token 即可
1
| rm -rf C:\Users\username\.git-credentials
|
1 2
| rm -rf /home/username/.git-credentials rm -rf /Users/username/.git-credentials
|
SSH 免密登录
生成密钥
1
| ssh-keygen -t rsa -b 4096 -C "uesrname@xxx.com"
|
- 修改命令
1
| git remote origin set-url [url]
|
- 先删后加
1 2
| git remote rm origin git remote add origin [url]
|
- 编辑 .git 中 config