- 注册github账号(52136)
- 创建仓库repository(52136.github.io)。备注必须和账号名相同
- 依次安装以下两个软件
- Node.js
- Github for windows
- 在windows中打开CMD,然后依次执行如下命令:
- 1、ssh -T git@github.com
-
- 安装hexo:(系统会自动添加目录到PATH环境变量)
- cd / 设置安装目录
- npm install hexo-cli -g
- cd Hexo (进入Hexo目录)
- npm install
- hexo generate
- hexo server
备注:需设置环境变量:http://www.cnblogs.com/SCOOL/p/4054045.html
- 此时打开浏览器,在浏览器地址栏输入 http://localhost:4000/ (默认端口为4000), 便可以看到最原始的博客了。
【将本地文件部署到github上】
此处红色框内应填写http://github.com/52136/52136.github.io.git
错误处理方法:
将deploy 的 type 改成 git,然后再在 Git Shell 中运行以下命令:
npm install hexo-deployer-git –save
再重新来一遍:
- hexo clean
- hexo generate
- hexo deploy
解决办法:
执行这两条命令即可解决
$git config –global user.email {emailaddress}
$git config –global user.name {name}
3、成功界面
恭喜,到这一步,个人博客就已经部署到 GitHub 上了,你可以到你的GitHub仓库查看是否已经更新。此时,通过 your_user_name.github.io(即你那个仓库的名称,形如:”你的 GitHub 用户名”.github.io),就可以看到你的个人博客了。