I am using a new computer and have to move the hexo to this one. Here is how I did it.
I actually clone the repo here. my github io
After that, I delete all the file and keep the .git. Then I copy all the file from my origin computer to this new samohyes.github.io. After this, I create a new branch hexo. Then, I did
git add --all
git commit -m 'new branch'
According to the tutorial, I am good to go now. But when I type
hexo g
hexo d
I got this.
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)
So, I assume there is something wrong with the ssh key. I may need to add one. Then I type
ssh-keygen.exe
And got the public and private key at c:/usr/myname/.ssh/ .I upload the public key to the repo on github. After that, I do
ssh -T git@github.com
And got this successful information.
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.
I should be all right now. But when I type hexo d , again it comes this error.
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)
And I edit the _config.yml file change the following lines.
deploy:
type: git
repo: git@github.com:samohyes/samohyes.github.io.git
branch: hexo
Anyone know why? Thanks!