I was reading up on http://pages.github.com/ and one thing caught my eye:
If you create a new root branch named gh-pages in your repository, any content pushed there will be published to [url]
I searched everywhere for information about root branches, but there don't seem to be many resources on this. Does anybody know how to best explain what root branches are?
My current understanding is that if there are two root branches, they essentially represent two 'repositories' within one repository. Is this accurate?
The steps given in the link you mentioned tell you how to create one:
$ cd /path/to/fancypants
$ git symbolic-ref HEAD refs/heads/gh-pages
$ rm .git/index
$ git clean -fdx
A root branch is basically a "branch" that is started as an orphan and has no previous history. While every repo starts with a master and the branches are branched off from that, a root branch will not be branched off from master ( of course there are repos with no master, renamed master etc, but master is the common case) and have its own history. Conceptually, yes, it is like two repos in a repo.
In the above steps, the gh-pages
is created as a root branch.
Also see my answer here: How do I create a commit without a parent in Git?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With