{"thread":{"id":"12636","subject":"commit 0? (or: create new empty branch)","startedAt":"2008-03-11T12:30:04Z","lastAt":"2008-03-11T14:59:54Z","messageCount":5,"participants":["Luciano Rocha","Johannes Schindelin","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"71688","messageId":"20080311123004.GA27577@bit.office.eurotux.com","threadId":"12636","inReplyTo":null,"subject":"commit 0? (or: create new empty branch)","fromName":"Luciano Rocha","fromEmail":"luciano@eurotux.com","sentAt":"2008-03-11T12:30:04Z","receivedAt":"2008-03-11T12:30:04Z","isPatch":false,"sender":{"key":"luciano@eurotux.com","avatar":null},"body":"\nHello,\n\nI'd like to create a new branch, without any pre-existing data, for\npurposes similar to git's html/man/.....\n\nHowever, I've been unable to do that using the higher level tools.\n\nEven starting from an empty git rep, I can't create a branch:\n\n$ git init\nInitialized empty Git repository in .git/\n$ git branch empty\nfatal: Not a valid object name: 'master'.\n\nHow were the different git.git branches created?\n\nRegards,\nLuciano Rocha\n\n-- \nLuciano Rocha <luciano@eurotux.com>\nEurotux Informática, S.A. <http://www.eurotux.com/>\n"},{"id":"71692","messageId":"alpine.LSU.1.00.0803111350550.3873@racer.site","threadId":"12636","inReplyTo":"20080311123004.GA27577@bit.office.eurotux.com","subject":"Re: commit 0? (or: create new empty branch)","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-03-11T12:52:00Z","receivedAt":"2008-03-11T12:52:00Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 11 Mar 2008, Luciano Rocha wrote:\n\n> I'd like to create a new branch, without any pre-existing data, for\n> purposes similar to git's html/man/.....\n\nIf there is nothing to branch from, there is nothing to branch from.\n\nYou might want to rename your branch (once you have something).\n\nBut then, I do not even understand why you bother.  You can always push to \na branch of a different name, and have your principal branch being \n\"master\" locally.\n\nHth,\nDscho\n"},{"id":"71695","messageId":"47D6843A.1030200@viscovery.net","threadId":"12636","inReplyTo":"20080311123004.GA27577@bit.office.eurotux.com","subject":"Re: commit 0? (or: create new empty branch)","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-03-11T13:08:10Z","receivedAt":"2008-03-11T13:08:10Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Luciano Rocha schrieb:\n> I'd like to create a new branch, without any pre-existing data, for\n> purposes similar to git's html/man/.....\n> \n> However, I've been unable to do that using the higher level tools.\n> \n> Even starting from an empty git rep, I can't create a branch:\n> \n> $ git init\n> Initialized empty Git repository in .git/\n> $ git branch empty\n> fatal: Not a valid object name: 'master'.\n> \n> How were the different git.git branches created?\n\nThere are two ways:\n\n1. Plumbing level\n\n  $ git symbolic-ref HEAD refs/heads/html\n  $ rm .git/index\n  ...commit new content...\n\n2. Porcelain level\n\n  $ mkdir ../html && cd ../html\n  $ git init\n  ...commit new content...\n  $ cd -   # go back\n  $ git fetch ../html master:html\n\n-- Hannes\n"},{"id":"71710","messageId":"20080311144515.GB12258@bit.office.eurotux.com","threadId":"12636","inReplyTo":"alpine.LSU.1.00.0803111350550.3873@racer.site","subject":"Re: commit 0? (or: create new empty branch)","fromName":"Luciano Rocha","fromEmail":"luciano@eurotux.com","sentAt":"2008-03-11T14:45:15Z","receivedAt":"2008-03-11T14:45:15Z","isPatch":false,"sender":{"key":"luciano@eurotux.com","avatar":null},"body":"On Tue, Mar 11, 2008 at 01:52:00PM +0100, Johannes Schindelin wrote:\n> Hi,\n> \n> On Tue, 11 Mar 2008, Luciano Rocha wrote:\n> \n> > I'd like to create a new branch, without any pre-existing data, for\n> > purposes similar to git's html/man/.....\n> \n> If there is nothing to branch from, there is nothing to branch from.\n> \n> You might want to rename your branch (once you have something).\n> \n> But then, I do not even understand why you bother.  You can always push to \n> a branch of a different name, and have your principal branch being \n> \"master\" locally.\n\nIt's not a matter of pushing/pulling. I'm referring to local branches\nonly.\n\nWhat I'd like to have is, using util-linux-ng as an example:\n\nbranch master: util-linux-ng plus local patches\nbranch vendor: util-linux-ng upstream\nbranch metadata: information on util-linux-ng, how to compile,\n    dependencies, etc.\n\nI'd have no problems with the first branches. But when I wanted to\ncreate the third, that shares no files with the others, I stumbled with\nthe problem of creating a clean branch. I really didn't want to create a\nbranch them do \"git rm .\".\n\nJohannes's tricks did the thing. Thank you all.\n\nRegards,\nLuciano Rocha\n\n-- \nLuciano Rocha <luciano@eurotux.com>\nEurotux Informática, S.A. <http://www.eurotux.com/>\n"},{"id":"71716","messageId":"alpine.LSU.1.00.0803111557130.3873@racer.site","threadId":"12636","inReplyTo":"20080311144515.GB12258@bit.office.eurotux.com","subject":"Re: commit 0? (or: create new empty branch)","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-03-11T14:59:54Z","receivedAt":"2008-03-11T14:59:54Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 11 Mar 2008, Luciano Rocha wrote:\n\n> On Tue, Mar 11, 2008 at 01:52:00PM +0100, Johannes Schindelin wrote:\n> \n> > On Tue, 11 Mar 2008, Luciano Rocha wrote:\n> > \n> > > I'd like to create a new branch, without any pre-existing data, for \n> > > purposes similar to git's html/man/.....\n> > \n> > If there is nothing to branch from, there is nothing to branch from.\n> > \n> > You might want to rename your branch (once you have something).\n> > \n> > But then, I do not even understand why you bother.  You can always \n> > push to a branch of a different name, and have your principal branch \n> > being \"master\" locally.\n> \n> It's not a matter of pushing/pulling. I'm referring to local branches \n> only.\n> \n> I'd have no problems with the first branches. But when I wanted to \n> create the third, that shares no files with the others, I stumbled with \n> the problem of creating a clean branch. I really didn't want to create a \n> branch them do \"git rm .\".\n> \n> Johannes's tricks did the thing. Thank you all.\n\nMy tricks?\n\nI know, you do not have to reply, but you should have taken a bit more \ncare there.\n\nBTW the recommended way is really to go outside and push (slight variation \non Hannes' 2nd method):\n\n# create new repository\n$ mkdir new-root && cd new-root && git init\n\n# initialise master branch\n$ vi <file> && git add <file> && git commit <file>\n\n# push it into the original repository as a new branch\n$ git push .. master:refs/heads/<new-branch>\n\nCiao,\nDscho\n"}]}