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

一、问题描述

Git Push 失败,具体错误信息如下:

Pushing to XXX 2023-11-15 18:19:31.668 git-credential-sourcetree[4057:5511477] Error (internetKeychainItemForServer:withUsername:path:port:protocol:) - The specified item could not be found in the keychain.
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: Authentication failed for 'XXX'
Pushing to XXX 2023-11-15 18:19:48.736 git-credential-sourcetree[4178:5512061]
Error (internetKeychainItemForServer:withUsername:path:port:protocol:) - The specified item could not be found in the keychain.User cancelled password prompt.2023-11-15 18:19:52.918 git-credential-sourcetree[4178:5512061] User cancelled pa...

Git 用户鉴权认证失败 ,因为GitHub在2021年8月13日删除了对密码认证的支持,而改用token的方式进行登录鉴权。

所以就需要先通过用户名/密码的方式先登录到GitHub平台,然后生成自己的Token,并且用Token来实现代码仓库的操作。

简言之:原登陆方式:用户名+密码;现登陆方式:用户名+token

二、解决

1、登陆GitHub,打开settings,打开 开发者设置

打开设置

2、生成tokens

生成tokens位置
注意时间和勾选
注意勾选


3、使用本次生成的用户名+token去登陆,然后Push即可

生成token串注意保存
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容