Transfer Hexo Blog from Windows to Mac

My old laptop died last week after working for me for five years. And I bought a new M1 mac the next day. It is not hard to transfer hexo blog to a mac. The following are steps I take.

Step 1 Install git, node and hexo

brew install git
brew install node
npm install hexo g

Step 2 Initialize a hexo folder

Create a new folder for it and then call new terminal at folder with hexo init and git init.

Test the new folder with hexo s.

Step 3 Download your old hexo _post, themes folders and _config.yml

I used google drive for this. Compress them and then download. Replace the ones with them.

Step 4 Change your privilege level

First get info of your blog folder, make sure you have privilege to write to it.

And then use sudo chmod -R 777 testproject to change the permission level of your project directory.

Step 5 Configure git and add SSH

If you have configured git before, ignore this step.

git config --global "username"
git config --global ""

Then generate your SSH.

ssh-keygen -t rsa -C ""

You can find the generated SSH in ~/.ssh/

.ssh is a hidden folder. You can open it with open ~/.ssh // . Find there, and then add SSH to your GitHub account.

Or you can use cat ~/.ssh/ to print the key and then copt it.

Step 6 Deploy your blog

hexo g
hexo d

Input your github user name. As for the password, you should input your personal access code rather than your password anymore.

You can find more info about personal access code here.