(via [1] and [2])
add the following to the [remote "origin"] section of .git/config:
push = +refs/heads/master:refs/heads/gh-pages
push = +refs/heads/master:refs/heads/master
and whenever you push to origin, it pushes the code on your local master branch to both remote branches.