git branch: gh-pages

rubik picture rubik · Jan 20, 2011 · Viewed 46.1k times · Source

I have a repo on GitHub. Recently I have discovered GitHub's pages and I want to use them.
I would like to create this new branch and then, when I need to, either commit on master branch or on gh-pages branch.

How can I do this? Do I have to create another folder inside my repo?

Answer

Arrowmaster picture Arrowmaster · Jan 23, 2011

More recent versions of git have an alternative to the git symbolic-ref method that Chandru explained. This avoids having to use the lower level commands.

git checkout --orphan gh-pages
git rm -rf .