build enviroment
- install node, git and hexo;
git clone -b hexo https://github.com/curiosusJR/curiosusJR.github.io.git curiosus
cd cuirosus && sudo npm install
# init config and packages
github authentication
- configure github global setting with command
git config --global user.name ""
andgit config --global user.email ""
- “hexo d” and “git push” commands need to authenticate github by token;
- only repo and workflow is necessary.
NOTE: token should not be upload to remote repository, means .gitignore should include files below
token for hexo: vim ./_config.yml
1
2
3
4
5
6deploy:
type: git
repository: https://<token-for-hexo>@github.com/<user.name>/<repo.name>.git
branch: master
name: <user.name>
email: <email-address>token for git: vim ./.git/config
1
2[remote "origin"]
url = https://<token-for-hexo>@github.com/<user.name>/<repo.name>.gitvalid .gitignore after changing it by delet local cache:
1
2
3git rm -r --cached .
git add .
git commit -m 'update .gitignore'
daily use
- git pull # for latest data
- git branch -vv # check branch matchup between local and remote
- hexo n “<title>“ # hexo g; hexo d; et.al
NOTE: “hexo d” update the master branch contain website in github - git add . && git commit -m “
“ && git push # remember use command “git push” without “origin hexo” only when “git branch -vv” results a correct matchup.
NOTE: git push up date hexo branch contain source data