解决

生成令牌

首先生成一个令牌,←链接是官网教程,也可以不点,直接看下文。

1、点击Settings
gremote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead._git
2、点击左侧的Developer settings
gremote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead._官网_02
3、点击Personal access tokens(个人访问令牌)
gremote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead._github_03
4、点击Generate new token
gremote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead._新版本_04
5、设置token信息
gremote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead._用户名_05
点击Generate token生成令牌
得到生成的令牌

应用令牌

将生成的令牌拷贝下来(不要拷贝我的,拷贝你自己生成的!),记得保存,下次你就看不到了。

修改现有项目的url

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

1
将<your_token>换成你自己得到的令牌。是你自己github的用户名,是你的项目名称,比如我的:

 git remote set-url chatroom https://ghp_95QnXXg5SBlldUXUTAr2341b3amg4HXZ1koFvj@github.com/CJ-cooper6/chatroom.git

https://你的令牌@github.com//.git

然后再执行git pull,世界又恢复原样了。

全新版本

对于全新版本,克隆的时候也在github.com前面加个令牌就好了。

git clone https://<TOKEN>@github.com/<user_name>/<repo_name>.git