Copied from http://www.xanthir.com/b4Zz0
(This is a simplified version of the advice on Oli Studholme's blog, cut down to just the parts that I've actually needed. I do this often enough, and always forget the steps, so having it put down here is useful for me, and maybe for someone else.)
So you want to serve your repo from the http://user.github.io/repo
url, and don't have any reason to separate a "code" and "serve" branch. In other words, you want your GitHub repo to only use the gh-pages
branch, not master
. Here's an easy guide to making that happen.
First, if you already have a gh-pages branch, make sure it's synced up to master, showing exactly what you want. If you don't, type...
git checkout -b gh-pages