I'm using Jekyll with GitHub Pages (specifically, a project page). I've created 2 branches:
master
gh-pages
The documentation explains that the website content is stored in the gh-pages
branch and that content will be rendered by Jekyll. The output will be available at a URL such as username.github.io/project-name.
If I run jekyll new mysite
in my local master
branch, that creates _config.yml, _posts, _sites etc in that branch. At this point if I run jekyll serve
I can see a basic site at localhost:4000 (which is great).
My question:
Considering what I currently have in my master
branch currently seems to be working, what is the purpose of the gh-pages
branch? What exactly should be contained in a) master
branch and b) gh-pages
branch?
Thanks in advance.
Reading Github pages documentation :
You will only need to version your code and NOT the generated pages. So, only one branch is needed.
github.com/username/username.github.io
), you publish your code in
master
.github.com/username/projectRepository
), you publish your code in gh-pages
. Here you don't need a master
branch.You will need to version both your code and you generated pages. So, two branches will be needed.
User/organisation
repository : base code goes in code
(or
whatever you name it) branch, and generated pages goes in master
.Project
repository : base code goes in master
(or whatever you
name it) branch, and generated pages goes in gh-pages
.