MacOS github push 错误 ‘Authentication failed for 'https://github.com’

此文章针对2021年8月13日以后github强制token认证的error,密码错误的请查阅其他文章。

2021年8月13日以后,github不再接受用户名密码方式推送代码。Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.

下面是解决方案:

登录github,进入个人中心settings,下拉左侧list,找到Developer settings,选择Personal access tokens,选择generate new token ,根据需求选择权限范围,生成 token。

复制token,关闭此页后token不再能查询到,请妥善保管。否则重新生成一遍。

windows用户请自行查找github.com配置方法,修改password为token

Mac&Linux用户打开终端进行设置:

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

再次git push,认证通过!

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

推荐阅读更多精彩内容