Suppose you wanted to keep both branches (so you also have documentation).
You can simply run the script after clicking on master, which does:
git checkout gh-pages
wget https://github.com/{yourgitlogin}/{your-project}-master/archive/master.zip
git rm {your-project}-master
unzip master.zip && rm master.zip
git add -u
git add .
git commit -m "update master"
git push
git checkout master
Something like this will add your entire site as a subdirectory under the gh pages, allowing you to have both documentation and a modern example of your site in the same place and without much effort.
source
share