You want branch 'gh-pages' in your GitHub repository to be the same as 'master' branch. The simplest solution would be to configure git to push branch 'master' to 'gh-pages' automatically.
Assuming that your GitHub repository you push into is configured as 'origin' remote, you can somply do:
$ git config --add remote.origin.push +refs/heads/master:refs/heads/gh-pages
Or if you prefer you can simply edit .git/config
file directly.
Then when you do git push
or git push origin
you would push 'master' branch in your repository into 'gh-pages' branch into repository on GitHub.
See git-push manpage for documentation and description of refspec format.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…