如何将hexo移动到另一台计算机?

时间:2018-05-17 00:14:36

标签: git github hexo

我正在使用新计算机并且必须将hexo移动到此计算机。我就是这样做的。

我实际上在这里克隆了回购。 my github io

之后,我删除所有文件并保留.git。然后我将所有文件从我的原始计算机复制到这个新的samohyes.github.io。在此之后,我创建了一个新的分支hexo。然后,我做了

git add --all
git commit -m 'new branch'

根据教程,我现在很高兴。但是当我输入

hexo g
hexo d

我明白了。

FATAL Something's wrong. Maybe you can find the solution here: 
http://hexo.io/docs/troubleshooting.html
Error: git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

at ChildProcess.<anonymous> (E:\MyProject\samohyes.github.io\node_modules\hexo-util\lib\spawn.js:37:17)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at ChildProcess.cp.emit (E:\MyProject\samohyes.github.io\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

所以,我认为ssh键有问题。我可能需要添加一个。然后我输入

ssh-keygen.exe

在c:/usr/myname/.ssh/上获取公钥和私钥。我将公钥上传到github上的repo。在那之后,我做了

ssh -T git@github.com

获得了这个成功的信息。

PS E:\MyProject\samohyes.github.io> ssh -T git@github.com
Enter passphrase for key 'C:\Users\Xudon/.ssh/id_rsa':
Hi samohyes/samohyes.github.io! You've successfully authenticated, but 
GitHub does not provide shell access.

我现在应该没事。但是当我输入hexo d时,又出现了这个错误。

FATAL Something's wrong. Maybe you can find the solution here: 
http://hexo.io/docs/troubleshooting.html
Error: git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

at ChildProcess.<anonymous> (E:\MyProject\samohyes.github.io\node_modules\hexo-util\lib\spawn.js:37:17)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at ChildProcess.cp.emit (E:\MyProject\samohyes.github.io\node_modules\cross-spawn\lib\enoent.js:40:29)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

我编辑_config.yml文件会更改以下行。

deploy:
   type: git
   repo: git@github.com:samohyes/samohyes.github.io.git
   branch: hexo

任何人都知道为什么?谢谢!

0 个答案:

没有答案