This is the sequence of steps to follow to create a root gh-pages branch. It is based on a question at [SO]
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
| # create gh-pages branch | |
| git checkout --orphan gh-pages | |
| git rm -rf . | |
| touch README.md | |
| git add README.md | |
| git commit -m 'initial gh-pages commit' | |
| git push origin gh-pages | |
| # add gh-pages as submodule | |
| git checkout master |
| #!/bin/sh | |
| # Just copy and paste the lines below (all at once, it won't work line by line!) | |
| # MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
| function abort { | |
| echo "$1" | |
| exit 1 | |
| } | |
| set -e |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |