Re: Parent-less branches
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- May 3, 2008, 00:17 UTC
- Message-ID
- <m38wys6y1q.fsf@localhost.localdomain>
- In-Reply-To
- <20080502232008.GA20092@ulrik-ibook>
Ulrik Sverdrup <ulrik.sverdrup@gmail.com> writes:
Show 12 quoted lines
> Wincent Colaiuta <win@wincent.com> writes: >> >> I wanted to do this just the other day, but I did it all inside the >> one repo, and made some notes on the process here: >> >> http://rails.wincent.com/wiki/Creating_independent_branches_with_Git >> >> Basically, using "git write-tree" and "git commit-tree" plumbing. > > I think I've seen this done much simpler, in this blog post: > > http://madduck.net/blog/2007.07.11:creating-a-git-branch-without-ancestry/
And it is mentioned in http://git.or.cz/gitwiki/BlogPosts, athough not yet in either GitTips or GitFaq.
In short the solution is to create content-less branch using:
$ git symbolic-ref HEAD refs/heads/newbranch $ rm .git/index then commit.
> Even though your instructions seem more complicated than they are since > they mix setting up the parentless branch and preparing the first > commit content.
-- Jakub Narebski Poland ShadeHawk on #git