hexo synchronization blog

hexo build a lot, do not describe here the process online. The main talk between different computer synchronization hexo blog.

Create a remote repository

You can use github, OSC, coding, etc., the best choice for a private library, due to the github only private library is not free, want to save points can choose a free private library (such as OSC, coding).

Add the git SSH public key to the remote repository.

.gitignore operation

New or Open .gitignore in the root directory hexo

1
2
3
4
/.deploy_git
/public
/_config.yml
/node_modules

/.deploy_git and / public file during hexo dregenerates when
/ node_modules use npm installor cnpm install(Taobao mirror) regenerates
/_config.yml self-preservation, such as care can be uploaded to a remote repository

Hexo upload files to a remote repository

Open Git Bash at the root of hexo

1
2
3
4
5
6
7
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git init
git add .
git commit -m "first commit"
git remote add origin ssh地址
git push -u origin master

Other computer terminal operations

Hexo installation process is not described, to carry out hexo initthis step not need to take

In Git Bash interface to synchronize projects down

1
git clone SSH address

Save yourself as _config.yml file copied into the project root directory
proceed as follows

1
npm install or cnpm install (Taobao mirror)

Run hexo, later to simply enter the command can be run locally blog

1
hexo s -g

Open your browser, enter localhost: 4000, you can see your personal blog at local

Installation hexo git plugin

1
2
npm install hexo-deployer-git --save 
or cnpm install hexo-deployer-git --save ( Taobao mirror)

Release updates blog

1
hexo d -g

After successfully posted, visit the blog page addresses View the results can look!

Original: Big Box  hexo synchronization blog


Guess you like

Origin www.cnblogs.com/chinatrump/p/11614975.html