The following method only applies if the Hexo Blog folder has not been deleted

After the system is reinstalled, Hexo dependent plug-ins/software and cached data in disk C will be removed, so that Hexo commands cannot run. All, after reinstalling the system, will have to redeploy Hexo. But redeployment isn’t hard, just a few steps. Because my Hexo Blog folder is not stored on drive C, it was not deleted due to the reinstallation. All redeployment is easy.

Install Git and Node

git for windows: git-scm.com/ Node.js: nodejs.org/en/

Generating an SSH Key

Configure Git personal information and generate SSH keys open Git bash and type

 git config --global user.name "xxxxx"
 git config --global user.email "[email protected]"
 ssh-keygen -t rsa -C "[email protected]"
Copy the code

Replace XXXX with your own information, and then Enter all the way.

Example Set the Github SSH key

SSH folder containing id_rsa and id_rsa.pub. Copy the contents of id_rsa.pub.

Go to Github and click settings-ssh and GPG keys-new SSH key to paste the copied content into the key bar and save it.

If you want to synchronize blog to coding, copy id_rsa.pub to the SSH public key of coding

Install Hexo

Git bash: NPM install hexo-cli -g

Delete some files in the original blog folder

Open your original blog folder and simply leave the _config.yml, theme/, source/, scaffolds/, package.json,.gitignore projects and delete the other files.

Install dependency files

Type NPM install on git bash

Installing and deploying plug-ins

Type NPM install hexo-deployer-git –save on git bash

Finally, run hexo Clean && Hexo G && Hexo D to see if it succeeds.

This article reference helloqingfeng. Making. IO / 2017/02/25 /…