GitHub has a Project Pages feature that creates a webpage based on the content of the gh-pages branch of a repository. I asked, and subsequently answered, the question of how to get the Project Page to be an exact mirror of the Master branch over on Stack Overflow.
One way I found is to run the following command, which sets a configuration setting that causes every subsequent instance of
git push to push the Master branch of the repository into the gh-pages branch:
git config --add remote.origin.push +refs/heads/master:refs/heads/gh-pages
The trouble with this solution is that I'm using the GitHub Mac App, which doesn't use a strict
git push. According to their Help page, it does a
git pull --rebase. Additionally, even when I select Push from the Repository menu, my git config line isn't adhered to. I'm not sure what's up with that...
I ran through a bunch of my own tests, trying to figure out how this branch mirroring can be done in a GitHub-For-Mac-App-Friendly way. It doesn't seem like you need to go through the exact process they've described to create the gh-pages branch. Over there, they provide the following process along with the disclaimer "Caution: make your working directory clean before you do this (either stash or commit), otherwise this will lose any changes you've made to your project since the last commit.":
cd /path/to/repo-name git symbolic-ref HEAD refs/heads/gh-pages rm .git/index git clean -fdx echo "My GitHub Page" > index.html git add . git commit -a -m "First pages commit" git push origin gh-pages
Instead, you can simply create a new branch named gh-pages from within the GitHub Mac App. They probably don't instruct people to do this because what I'm accomplishing here isn't a typical scenario.
You can take these steps to create the 'gh-pages' branch from within the GitHub Mac App:
Each time you want to update your Project Page, just run these steps to sync your Master branch into your gh-pages branch within the GitHub Mac App:
16 Oct 2009 Holyoke's Center City Vision Plan
26 Jan 2012 View the changes between two branches of a git repository in SourceTree
04 Nov 2009 Some Fantastic Mac And iPhone Applications
15 Jun 2012 How to add auto-completion to git
30 Mar 2012 I put together the site for JeffreyB Photography