-bcoua
Last Updated: February 25, 2016
·
4.646K
· pr3ssh

How to create gh-pages branch

Note: This tip is only valid for GitHub

When you are working on a project on git master branch and you want to create a page in which you can explain the process or promote the most important parts of the project, the best way to do that is to create a gh-pages on GitHub that doesn't share git history. The way to do that is executing this command:

git checkout --orphan gh-pages

Once you have gh-pages branch without git history, you can write your own HTML page on that branch.

Note: With this command you can always create an orphan branh in case you want

4 Responses
Add your response

15203

cool trick! Didn't know about the --orphan option!

over 1 year ago ·
15216

Me neither. I discovered this option when I started to work with gh-pages in GitHub.

over 1 year ago ·
15236

Does the orphan branch have its own history?

over 1 year ago ·
15237
over 1 year ago ·