{"thread":{"id":"13359","subject":"Re: Parent-less branches","startedAt":"2008-05-02T23:20:10Z","lastAt":"2008-05-04T05:50:44Z","messageCount":4,"participants":["Ulrik Sverdrup","Jakub Narebski","Sverre Rabbelier","Daniel Barkalow"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"75889","messageId":"20080502232008.GA20092@ulrik-ibook","threadId":"13359","inReplyTo":null,"subject":"Re: Parent-less branches","fromName":"Ulrik Sverdrup","fromEmail":"ulrik.sverdrup@gmail.com","sentAt":"2008-05-02T23:20:10Z","receivedAt":"2008-05-02T23:20:10Z","isPatch":false,"sender":{"key":"ulrik.sverdrup@gmail.com","avatar":null},"body":"> I wanted to do this just the other day, but I did it all inside the  \n> one repo, and made some notes on the process here:\n> \n> http://rails.wincent.com/wiki/Creating_independent_branches_with_Git\n> \n> Basically, using \"git write-tree\" and \"git commit-tree\" plumbing.\n> \n> Cheers,\n> Wincent\n\nI think I've seen this done much simpler, in this blog post:\n\nhttp://madduck.net/blog/2007.07.11:creating-a-git-branch-without-ancestry/\n\nEven though your instructions seem more complicated than they are since\nthey mix setting up the parentless branch and preparing the first\ncommit content.\n\nregards,\nulrik\n\n(I am not on the list, please CC)\n"},{"id":"75894","messageId":"m38wys6y1q.fsf@localhost.localdomain","threadId":"13359","inReplyTo":"20080502232008.GA20092@ulrik-ibook","subject":"Re: Parent-less branches","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-05-03T00:17:43Z","receivedAt":"2008-05-03T00:17:43Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Ulrik Sverdrup <ulrik.sverdrup@gmail.com> writes:\n> Wincent Colaiuta <win@wincent.com> writes:\n>>\n>> I wanted to do this just the other day, but I did it all inside the  \n>> one repo, and made some notes on the process here:\n>> \n>> http://rails.wincent.com/wiki/Creating_independent_branches_with_Git\n>> \n>> Basically, using \"git write-tree\" and \"git commit-tree\" plumbing.\n> \n> I think I've seen this done much simpler, in this blog post:\n> \n> http://madduck.net/blog/2007.07.11:creating-a-git-branch-without-ancestry/\n\nAnd it is mentioned in http://git.or.cz/gitwiki/BlogPosts, athough not\nyet in either GitTips or GitFaq.\n\n\nIn short the solution is to create content-less branch using:\n\n  $ git symbolic-ref HEAD refs/heads/newbranch\n  $ rm .git/index\n \nthen commit.\n\n> Even though your instructions seem more complicated than they are since\n> they mix setting up the parentless branch and preparing the first\n> commit content.\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"75898","messageId":"bd6139dc0805021746q40b384c3nb36a8605d9475a7f@mail.gmail.com","threadId":"13359","inReplyTo":"m38wys6y1q.fsf@localhost.localdomain","subject":"Re: Parent-less branches","fromName":"Sverre Rabbelier","fromEmail":"alturin@gmail.com","sentAt":"2008-05-03T00:46:01Z","receivedAt":"2008-05-03T00:46:01Z","isPatch":false,"sender":{"key":"alturin@gmail.com","avatar":null},"body":"On Sat, May 3, 2008 at 2:17 AM, Jakub Narebski <jnareb@gmail.com> wrote:\n>  In short the solution is to create content-less branch using:\n>\n>   $ git symbolic-ref HEAD refs/heads/newbranch\n>   $ rm .git/index\n>\n>  then commit.\n\nI guess what Pedro is asking is if there isn't a builtin way to do\nthis. Which, if I understand correctly, there isn't. Perhaps though\nsomething like \"git branch -N newbranchname\" which then creates a new\nparentless branch. It could just be a shell script that does the\nabove, but I wonder if there are no side-effects of the above? It\nsounds somewhat 'messy' to remove the index? Too 'low level' to do for\na user I mean, what if sometime in the future we decide to store\nsomething in the index that -is- important? I reckon it would be\ncleaner to add an option for this.\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"75989","messageId":"alpine.LNX.1.00.0805040139310.19665@iabervon.org","threadId":"13359","inReplyTo":"bd6139dc0805021746q40b384c3nb36a8605d9475a7f@mail.gmail.com","subject":"Re: Parent-less branches","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-05-04T05:50:44Z","receivedAt":"2008-05-04T05:50:44Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Sat, 3 May 2008, Sverre Rabbelier wrote:\n\n> On Sat, May 3, 2008 at 2:17 AM, Jakub Narebski <jnareb@gmail.com> wrote:\n> >  In short the solution is to create content-less branch using:\n> >\n> >   $ git symbolic-ref HEAD refs/heads/newbranch\n> >   $ rm .git/index\n> >\n> >  then commit.\n> \n> I guess what Pedro is asking is if there isn't a builtin way to do\n> this. Which, if I understand correctly, there isn't. Perhaps though\n> something like \"git branch -N newbranchname\" which then creates a new\n> parentless branch. It could just be a shell script that does the\n> above, but I wonder if there are no side-effects of the above? It\n> sounds somewhat 'messy' to remove the index? Too 'low level' to do for\n> a user I mean, what if sometime in the future we decide to store\n> something in the index that -is- important? I reckon it would be\n> cleaner to add an option for this.\n\nIf sometime in the future we decide to store something in the index that \nis important, we'll definitely want to remove the index, because whatever \nit is will be both important and -wrong- for a new parentless commit, \nsince a new root should have all the default values, not values acquired \nduring the other history in the repo.\n\nOn the other hand, a builtin command of that sort probably ought to make \nsure that there aren't any uncommitted changes before doing this. And it \nshould probably be called \"git checkout -b name -N\", since it makes it \nyour current branch, rather than creating it like \"git branch ...\" would \nsuggest.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}