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
Written by Pablo
Related protips
4 Responses
cool trick! Didn't know about the --orphan option!
over 1 year ago
·
Me neither. I discovered this option when I started to work with gh-pages in GitHub.
over 1 year ago
·
Does the orphan branch have its own history?
over 1 year ago
·
@talves Yes
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Gh-pages
Authors
pr3ssh
6.408K
anasnakawa
1.663K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#