When you have the ability to use hexo, you may be wonder what should we do if my device lost or
broken, how to store and transfer my source of hexo, now you need follow below these steps:
init git and create branch from your blog repository
1
2
3cd Hexo
git init
git branch sourceedit .gitignore and add hexo source
1
2
3
4git status
git add * or git add .
git add .gitignore
git commit -m "add source"add themes/minos
if you wants to add themes/minos source,it failed, you will see:1
fatal: Pathspec 'xxxx' is in submodule 'themes/minos'
because .git dir exist in themes/minos, you should do this:
1
2git rm --cached themes/minos/
git add themes/minos/push branch
1
2
3git branch -a
git remote add origin https://github.com/geoxing/geoxing.github.io.git
git push --set-upstream origin sourcefirst store over
update when source changed
1
2
3git status
git add source/_posts/how-to-store-hexo-source-and-theme-on-github.md
git push -u origin sourceenjoy