github push报错:不再支持密码
现象
$ git push
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'xxxxx'
解决办法
1.将本地id_rsa.pub
拷贝到 github 的 SSH keys 中
打开github,点击右上角头像,弹出列表,点击“Settings”,点击左侧栏目上的“SSH and GPG keys”,再点击“New SSH Key”,将本地~/.ssh/id_rsa.pub
中的内容复制进去。
2.修改本地git的remote url
在代码仓库复制ssh地址,然后在本地执行:
git remote set-url origin ssh地址
本文来自博客园,作者:ssh_alitheia,转载请注明原文链接:https://www.cnblogs.com/shanchuan/p/15222142.html
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步