GitHub Pages
So, I hit the button in GitHub to generate a project page for Jack and promptly spent the next 30 minutes figuring out how to check the gh-pages branch out into my local repo.
The following is what I did to get everything working. Note, make sure you’ve got all your local changes committed or stashed before doing this as they will be lost otherwise.
git clone git@github.com:dj2/jack.git Jack
cd Jack
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -f -d -x
git pull origin gh-pages
If you didn’t use the generate page button in the GitHub website you can follow the directions here to get your project page up and running.
Once this is done you should be able to git checkout master and git checkout gh-pages to edit the code or website.
Thanks for this! I don’t know why they haven’t made any clarifications regarding this. Maybe it’s supposed to be obvious for people who are experienced with git, but for someone like me this is anything but obvious. I actually submitted a support ticket regarding this, and maybe they can give me a better way to do it since I feel like there has to be a better way to do it, with git fetch or something.
Thanks for the tip, GitHub should really explain this aspect of pages better for Git n00bs like myself. For completeness, it might be worth mentioning the commands necessary to push changes back to GitHub itself. The following worked for me:
(edit files),
git add / commit etc.,
git push origin gh-pages