文章目录
  1. 1. 在github.io或者终端新建hexo分支,并设为默认分支,_config.yml配置推送为master
  2. 2. 推送到github
  3. 3. 其他电脑首次开始写作
  4. 4. 写作之后
  5. 5. 同步文件
  6. 6. 下次写作
  7. 7. 第一台电脑继续

多终端写作

在github.io或者终端新建hexo分支,并设为默认分支,_config.yml配置推送为master

1
2
3
4
5
6
7
8
# 新建新分支
git checkout -b hexo

# 切换分支
git checkout hexo

# 查看分支
git branch

推送到github

1
2
3
4
git add .
git commit -m "新建分支"
git remote add origin https://github.com/jim-bin/jim-bin.github.io.git
git push -u origin hexo # -f 强制推送

其他电脑首次开始写作

1
2
3
4
git clone https://github.com/jim-bin/jim-bin.github.io.git
npm install hexo-cli -g
npm i hexo --save
npm install hexo-deployer-git --save

写作之后

1
2
3
4
5
6
7
# 在本地查看示例(localhost:4000)
hexo g
hexo s

# 部署
hexo new post "title"
hexo d -g

同步文件

1
2
3
git add .
git commmit -m "some"
git push origin hexo

下次写作

1
2
3
4
git pull # 或者 git pull origin hexo
git add .
git commmit -m "some"
git push origin hexo

第一台电脑继续

1
2
3
4
git pull # 或者 git pull origin hexo
git add .
git commmit -m "some"
git push origin hexo
文章目录
  1. 1. 在github.io或者终端新建hexo分支,并设为默认分支,_config.yml配置推送为master
  2. 2. 推送到github
  3. 3. 其他电脑首次开始写作
  4. 4. 写作之后
  5. 5. 同步文件
  6. 6. 下次写作
  7. 7. 第一台电脑继续
Fork me on GitHub