Mirroring master on Github pages
I am currently working on a project that only involves Javascript for application logic and can be completely hosted out of Github Pages
So the entire code has to be both in master as well as gh-pages branch. Initially I was merging master into gh-pages and deploying but that kind of felt cumbersome with number of pushes that might be involved.
I quickly googled for a better solution and there is a nifty way to push to two branches at the same time. I added these lines to my .git/config in [remote "origin"] section
push = +refs/heads/master:refs/heads/gh-pages
push = +refs/heads/master:refs/heads/master
What this means whenever you do a "git push origin" it pushes your local master to both gh-pages and master branches to origin.
Now that I have done this, I am anticipating a scenario where I might want to push a stable branch to gh-pages and keep master at bleeding edge. I might add a different line like the following line which would push local stable branch to origin gh-pages
push = +refs/heads/stable:refs/heads/gh-pages