— Sal Ferrarello (@salcode) June 14, 2015
So I was just trying to incorporate this on my workflow, but after few commits I felt this is a messy approach to keep switching between master and gh-pages branches and keeping them in sync, hence I googled and of course found a better way to automate it–
Just add following two lines to [remote “origin”] section of your local .git/config file:-
push = +refs/heads/master:refs/heads/gh-pages
push = +refs/heads/master:refs/heads/master
After this, you can keep working on your master branch, but then everytime you will push – that will automatically trigger the further push/sync to gh-pages.