解决remote: Support for password authentication was removed on August 13, 2021.

2022-11-29

咱们就从github开始吧,注册就不多说了
新建项目
image
然后给项目起名字创建
image-1669710094210

遇到问题一:

❯ git push origin main
Username for 'https://github.com': ilovedo@126.com
Password for 'https://ilovedo@126.com@github.com':
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/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/lamubida/TestApp.git/' 鉴权失败

解决办法:
1.在git上生成令牌,用在仓库中
image-1669710544448
image-1669710594521
image-1669710620166
image-1669710653521
image-1669710758576
按照步骤来,保存好自己生成的令牌
2.修改现有的url

git remote set-url origin  https://<your_token>@github.com/<username>/<pero>.git

<your_token>换成你自己得到的令牌
< username>是你自己github的用户名
< pero>是你的项目名称

image-1669711058919
然后再次执行 pull push 操作,大功告成。