How to create blank Git branches

Post date: Jun 23, 2011 6:28:7 PM

"Most of the time in git you will be creating branches of your main project and working on them.

What if you wanted to create a 'documentation' branch or something?

It doesn't really deserve it's own repository because it's so closely related. The git project repository does this. The git project repository has separate branches for master, docs and man pages etc too.

Here's how you do it. Go into your git project and type:

git symbolic-ref HEAD refs/heads/empty echo 'New blank branch' >README git add README git commit -m 'New blank branch'

That's it - now you have a new branch 'empty'."

Via Tim Dysinger's blog: http://dysinger.net/2008/03/31/creating-blank-git-branches/