blog-hexo部署到GitHub出现的问题

参考1:
https://gugeshenjineng.github.io/2021/07/02/hexo%E9%83%A8%E7%BD%B2%E5%88%B0GitHub%E5%87%BA%E7%8E%B0%E7%9A%84%E9%97%AE%E9%A2%98/

参考2:
https://stackoverflow.com/questions/13363553/git-error-host-key-verification-failed-when-connecting-to-remote-repository/29908140#29908140

1、在hexo d之后,出现如下代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
ERROR: Permission to gugeshenjineng/gugeshenjineng.github.io.git denied to googleshenjineng.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
FATAL {
err: Error: Spawn failed
at ChildProcess.<anonymous> (G:\blog\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (events.js:375:28)
at ChildProcess.cp.emit (G:\blog\node_modules\cross-spawn\lib\enoent.js:34:29)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
code: 128
}
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html

2、解决办法:stackoverflow解答
I had the similar issue, but, using SSH keys. From Tupy’s answer, above, I figured out that the issue is with known_hosts file not being present or github.com not being present in the list of known hosts. Here are the steps I followed to resolve it -

1
2
3
4
5
1、mkdir -p ~/.ssh
2、ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
3、ssh-keygen -t rsa -C "user.email"
4、open the public key with this command $ cat ~/.ssh/id_rsa.pub and copy it.
5、Add the id_rsa.pub key to SSH keys list on your GitHub profile.

补充-在GitHub上添加ssh key
-1-mac的.ssh文件夹里,id-rsa.pub,可以将这个文件在编辑器中打开,然后全选复制
-2-登录GitHub,在设置里的ssh and gpg keys这里新建ssh key
-3- 将1中的复制内容粘贴在文本框里,title随便写
测试是否设置成功:

1
ssh -T git@github.com