PAT代替密码验证
2021年8月13日git终止密码验证提交程序,强制使用PAT验证方式,这是一件好事,减少密码泄露。
fatal: unable to access 'https://github.com/wsp666/wsp666.github.io/': The requested URL returned error: 403
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Spawn failed
at ChildProcess.<anonymous> (D:\Hexo\blog\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (events.js:210:5)
at ChildProcess.cp.emit (D:\Hexo\blog\node_modules\cross-spawn\lib\enoent.js:34:29)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
方法
通过"github -> account -> settings -> Developer settings -> Personal access tokens"处,点击Generate new token
。因为只是需要git push
之类的操作,所以勾选repo
选项,即可。随后token生成成功,然后再在本地git bash
中进行git push
,账号还是原来的github账号,密码改为填写刚刚生成的token即可。之后就不会再重复输入密码了。
保存好代码后直接替换之前的密码即可。可在凭据管理器中查看相关信息。