git - 如何将 hexo 移至另一台计算机?
问题描述
我正在使用一台新计算机,并且必须将 hexo 移到这台计算机上。这是我的做法。
我实际上在这里克隆了 repo。 我的 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
有谁知道为什么?谢谢!
解决方案
推荐阅读
- php - 从数组中列出 sql 查询中的重复项
- c# - IAsyncEnumerable 或 IAsyncEnumerator 的工厂
- javascript - 找不到最近的元素
- python - 在 json 文件 python 中添加多个嵌套的用户输入键
- r - 将带有“x 小时 y 分钟”的时间格式转换为数字
- react-native - React Native : UIkitten Icons typeerror: undefined is not an object (evalating 'iconsPack.name')
- css - 单击时删除悬停样式,直到下一次元素悬停
- json - 通过检查 JMeter 中的响应正文停止发送请求
- reactjs - React-materialize Chip - Javascript 插件 - 自动完成:如何更新状态变量
- c# - FluentValidation:使用来自其他属性的值自定义错误消息