I've just cloned a repo I have hosted on Github but this only checked out the
git checkout -b gh-pages origin/gh-pages
git branch -f gh-pages upstream/gh-pages
git branch -a
remotes/origin/HEAD -> origin/master
gh-pagesif that branch doesn't exist.
Personally, I prefer declaring
gh-pages branch as a submodule.
That allows you to work on master, while seeing/updating the
gh-pages content in a
gh-pages subfolder (declared as a submodule).
Update August 2016: Simpler GitHub Pages publishing now allows to keep your page files in a subfolder of the same branch (no more
So you don't even have to checkout another branch now (uf the upstream repo chose the new content organization)