From: Jakub Narebski Date: Sat, 03 May 2008 00:17:43 GMT Subject: Re: Parent-less branches Message-ID: In-Reply-To: <20080502232008.GA20092@ulrik-ibook> Ulrik Sverdrup writes: > Wincent Colaiuta 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