4 ms·
Github also takes advantage of this; if you make an empty branch called "gh-pages", and put static html (and css, js) in it, Github will host them for you. I'v
by psadauskas 16y ago
Github also takes advantage of this; if you make an empty branch called "gh-pages", and put static html (and css, js) in it, Github will host them for you.
I've also used it to greenfield some ideas in the same project. Its a bit of a hack to create one, though:
git symbolic-ref HEAD refs/heads/newbranch
rm .git/index
git clean -fdx
<do work>
git add your files
git commit -m 'Initial commit'
(From http://book.git-scm.com/5_creating_new_empty_branches.html http://book.git-scm.com/5_creating_new_empty_branches.html)
- davvid 16y agoThe community git book will often do things "the old fashioned way" to keep compatibility with older versions of git. Modern versions of git let you do this instead: git checkout --orphan new-branch