Which Branch for Github-Pages


What is your best practice for using branches and Github Pages? Do you use the master branch or gh-pages for project pages?


I’d say use the master branch - starting sometime last summer (see Simpler GitHub Pages publishing) you can publish your master branch or even just the /docs folder of your master branch (see the settings page / tab on GitHub for turning on/off publishing). Cheers.

PS: If you use your own build / setup w/ custom plugins etc.with travis ci and friends use the gh-pages branch for committing / saving your _site folder.


The gh-pages branch is mostly used for project based pages. I.e if You, Bob, clone Alice’s GH pages repo (alice/alice.github.io) You cannot serve it from master branch of bob/alice.github.io, because Your user names are different. When using gh-pages branch for the project the page will be accessible from http://bob.github.com/projectname/ i.e http://bob.github.com/alice.github.io/.