一、问题描述
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串注意保存
网友评论