Making a project site
Go to your local repository and create and switch to an
gh-pages branch. (It’s an “orphan”
branch because it won’t contain the whole history of your project.)
cd my_repo git checkout --orphan gh-pages
git rm -rf .
Now go back one directory and clone the present repository.
cd .. git clone git://github.com/kbroman/simple_site
Change into that directory and remove the
cd simple_site \rm -rf .git
Move all of the stuff from that directory into your repository
(in the new and empty
cd ../my_repo cp -r ../simple_site/. .
Edit everything as before.
Commit everything and push the
gh-pages branch to github.
git add . git commit -m "Initial commit of web site" git push origin gh-pages
Now you’ll switch back-and-forth between the
gh-pages branch (to
edit your website) and the
master or other branchs (to edit your
Personally, I’ll clone a separate copy of my repository, one directory
Web/, that is sitting in the
gh-pages branch. Then
rather than using
git checkout to switch between the code and the
web, I switch from one directory to another.