Assuming this directory structure:
project
|-- src
| +-- (source files)
+-- html
+-- (generated html)
Goal: We want to simultaneously:
- host source files in www.github.com/user/project
- host generated HTML files in user.github.com/project/html
Set up the repo:
git init
git remote add origin <github repository location>
Add the source files to the master branch:
git add src
git commit -m "initial source commit"
git push origin master
Add the output files to an orphan gh-pages
branch:
git checkout --orphan gh-pages
git rm src
git add html
git commit "initial html commit"
git push origin gh-pages
Now to update the repo do:
git checkout master
git commit -am <commit message>
git push origin master
# generate HTML in /html
git checkout gh-pages
git commit -am "regenerating html"
git push origin gh-pages