命令行帮助
1 | D:\Github\blog-hexo>hexo -help |
常用命令:
hexo help #查看帮助 hexo init #初始化一个目录 hexo new "postName" #新建文章 hexo new page "pageName" #新建页面 hexo generate #生成网页,可以在 public 目录查看整个网站的文件 hexo server #本地预览,'Ctrl+C'关闭 hexo deploy #部署.deploy目录 hexo clean #清除缓存,强烈建议每次执行命令前先清理缓存,每次部署前先删除 .deploy 文件夹 简写: hexo n == hexo new hexo g == hexo generate hexo s == hexo server hexo d == hexo deploy
直接在命令行中操作出现一下错误:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18D:\Github\blog-hexo>hexo d
INFO Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
'git' �����ڲ����ⲿ���Ҳ���ǿ����еij���
�������ļ�
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: spawn git ENOENT
at notFoundError (D:\Github\blog-hexo\node_modules\hexo-deployer-git\node_modules\hexo-util\node_modules\cross-spawn\lib\enoent.js:11:11)
at verifyENOENT (D:\Github\blog-hexo\node_modules\hexo-deployer-git\node_modules\hexo-util\node_modules\cross-spawn\lib\enoent.js:46:16)
at ChildProcess.cp.emit (D:\Github\blog-hexo\node_modules\hexo-deployer-git\node_modules\hexo-util\node_modules\cross-spawn\lib\enoent.js:33:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
FATAL spawn git ENOENT
Error: spawn git ENOENT
at notFoundError (D:\Github\blog-hexo\node_modules\hexo-deployer-git\node_modules\hexo-util\node_modules\cross-spawn\lib\enoent.js:11:11)
at verifyENOENT (D:\Github\blog-hexo\node_modules\hexo-deployer-git\node_modules\hexo-util\node_modules\cross-spawn\lib\enoent.js:46:16)
at ChildProcess.cp.emit (D:\Github\blog-hexo\node_modules\hexo-deployer-git\node_modules\hexo-util\node_modules\cross-spawn\lib\enoent.js:33:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
原因是:git的执行目录没有加入系统环境变量。解决方案:1.将git加入环境变量Path中。2.直接在git shell中进行操作。我更习惯于方式2。
环境搭建好以后,常用到的就是增加新的博客然后提交git。以下操作均在git shell中操作
操作目录:
1 | YGC@YGC /d/Github |
1 | hexo n "Linux基础" |