github · Git
报错原文
remote: Support for password authentication was removed on August 13, 2021.
这是什么意思
GitHub 在 2021 年停止接受通过 https 的账号密码——不是你的密码错了,而是这种方式本身不再被接受。它出现在你保存的凭据是旧密码,或者你在提示处直接输入了密码的时候。想继续用 https,就在密码栏里填 personal access token;否则用 git remote set-url origin 换成 ssh 地址。改远端地址只是你自己克隆里的一行配置,不动任何提交,随时可以改回来。
怎么修
git remote set-url origin git@github.com:user/repo.git- 来自
- github
- Git
- 29
git 的错误几乎都是一种拒绝,意思是「在当前状态下做那件事会丢掉东西」;fatal: 表示它什么都没改就停了,而真正的解决办法往往在第一行下面的 hint: 行里。
怎么读报错
- 从第一行往下读。越往下越是工具内部的事,起因通常写在最上面。
- 有文件名和行号就从那里查——不是栈顶那一帧,而是最上面那条提到你自己写的文件的行。
- 把报错原文照样去搜,但先去掉你自己的路径和变量名,正是那些让搜索匹配不上。
- 同一种情况在不同版本里措辞不同。结果不对头,就把版本号一起加进查询。
- 粘贴修法之前,先确认它会丢掉什么。这里面有些是不能撤回的。
常见问题
Q. “remote: Support for password authentication was removed on August 13, 2021.” 是什么意思?
GitHub 在 2021 年停止接受通过 https 的账号密码——不是你的密码错了,而是这种方式本身不再被接受。它出现在你保存的凭据是旧密码,或者你在提示处直接输入了密码的时候。想继续用 https,就在密码栏里填 personal access token;否则用 git remote set-url origin 换成 ssh 地址。改远端地址只是你自己克隆里的一行配置,不动任何提交,随时可以改回来。
Q. 怎么修?
git remote set-url origin git@github.com:user/repo.git —— 执行前先看上面的说明,确认这条命令会丢掉什么。
Q. 这是哪个工具报的?
github。它属于Git,报错原文有 11 个词。
相关报错
fatal: Authentication failed for 'https://github.com/user/repo.git/'gitgit@github.com: Permission denied (publickey).sshfatal: Unable to create '/repo/.git/index.lock': File exists.gitnothing to commit, working tree cleangiterror: unable to unlink old 'dist/main.js': Permission deniedgitfatal: bad object 8a3f21cgitwarning: LF will be replaced by CRLF in package.json.gitThe file will have its original line endings in your working directorygit