Re: Why can't git open empty branches ?
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Apr 11, 2012, 10:59 UTC
- Message-ID
- <20120411105906.GA19823@burratino>
- In-Reply-To
- <4F855E6B.4010504@danisch.de>
Hadmut Danisch wrote:
Show 6 quoted lines
> when creating a new branch in git, it is by default filled with the > contents of the current branch. > > Sometimes a new but empty branch is needed. There are plenty of > instructions in the web to achieve this with „dirty tricks”, i.e. fiddle > around with git's internals.
git init ../unrelated-topic cd ../unrelated-topic hack away... git commit cd - git fetch ../unrelated-topic master:<new branch>
Or:
git checkout --orphan <new branch> git rm -fr . hack away...
Please feel free to contact the authors of the instructions you found on the web to fix them.
Thanks and hope that helps, Jonathan