gh-pages branch contains contents of _site folder. master branch contains jekyll files and templates.
git fetch --all
git pull --all
- Checkout into master branch.
- Write post in _post folder.
- Run jekyll build locally on your own machine.
- Commit to master branch when done.
- cd to _site folder.
git pull
git checkout gh-pages
git add .
git commit -m "message"
And you're done.