{"thread":{"id":"10235","subject":"[FEATURE REQUEST] git clone, just clone selected branches?","startedAt":"2007-10-10T18:55:18Z","lastAt":"2007-10-11T09:18:38Z","messageCount":9,"participants":["Joakim Tjernlund","Johannes Schindelin","Linus Torvalds","Andreas Ericsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"55395","messageId":"011401c80b6f$1a11d1f0$04ac10ac@Jocke","threadId":"10235","inReplyTo":null,"subject":"[FEATURE REQUEST] git clone, just clone selected branches?","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2007-10-10T18:55:18Z","receivedAt":"2007-10-10T18:55:18Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":"To my knowlede a git clone always clones all branches from the remote repo.\nI would like the possibly to clone selected branches, like\n git clone <repo URL> -b master -b upstream\nwhich will only fetch the master and upstream branch.\n\nI know I can use git remote to do this, but it is a bit clumsy \nwhen starting a new repo.\n\nWhat do you think?\n\n Jocke\n"},{"id":"55400","messageId":"Pine.LNX.4.64.0710102032330.4174@racer.site","threadId":"10235","inReplyTo":"011401c80b6f$1a11d1f0$04ac10ac@Jocke","subject":"Re: [FEATURE REQUEST] git clone, just clone selected branches?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-10T19:35:02Z","receivedAt":"2007-10-10T19:35:02Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 10 Oct 2007, Joakim Tjernlund wrote:\n\n> To my knowlede a git clone always clones all branches from the remote \n> repo. I would like the possibly to clone selected branches, like\n>  git clone <repo URL> -b master -b upstream\n> which will only fetch the master and upstream branch.\n> \n> I know I can use git remote to do this, but it is a bit clumsy when \n> starting a new repo.\n\nThis is why I suggest: since it is an itch of yours, just fix it.  You are \nin the prime position to know when you're satisfied.\n\nAs a hint how to start: Junio dreamt of a git-clone which is a tiny \nwrapper around git-fetch and git-remote.\n\nSo you could start by writing a script which would be a replacement for \ngit-clone.sh, and there you can also include the support for -b that you \nwould like so much.\n\nIt would be nice, though, to keep this in separate patches, which you then \nsubmit to this list.\n\nThank you,\nDscho\n"},{"id":"55402","messageId":"alpine.LFD.0.999.0710101236350.20690@woody.linux-foundation.org","threadId":"10235","inReplyTo":"011401c80b6f$1a11d1f0$04ac10ac@Jocke","subject":"Re: [FEATURE REQUEST] git clone, just clone selected branches?","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-10-10T19:38:04Z","receivedAt":"2007-10-10T19:38:04Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 10 Oct 2007, Joakim Tjernlund wrote:\n> \n> I know I can use git remote to do this, but it is a bit clumsy \n> when starting a new repo.\n\nHow about just\n\n\tgit init\n\t.. set up remote tracking info in .git/config ..\n\tgit fetch remote\n\nwhich should do what you want.\n\n\t\tLinus\n"},{"id":"55415","messageId":"011b01c80b84$222d1e70$04ac10ac@Jocke","threadId":"10235","inReplyTo":"Pine.LNX.4.64.0710102032330.4174@racer.site","subject":"RE: [FEATURE REQUEST] git clone, just clone selected branches?","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2007-10-10T21:25:51Z","receivedAt":"2007-10-10T21:25:51Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":"> -----Original Message-----\n> From: Johannes Schindelin [mailto:Johannes.Schindelin@gmx.de] \n> Sent: den 10 oktober 2007 21:35\n> To: Joakim Tjernlund\n> Cc: git@vger.kernel.org\n> Subject: Re: [FEATURE REQUEST] git clone, just clone selected \n> branches?\n> \n> Hi,\n> \n> On Wed, 10 Oct 2007, Joakim Tjernlund wrote:\n> \n> > To my knowlede a git clone always clones all branches from \n> the remote \n> > repo. I would like the possibly to clone selected branches, like\n> >  git clone <repo URL> -b master -b upstream\n> > which will only fetch the master and upstream branch.\n> > \n> > I know I can use git remote to do this, but it is a bit clumsy when \n> > starting a new repo.\n> \n> This is why I suggest: since it is an itch of yours, just fix \n> it.  You are \n> in the prime position to know when you're satisfied.\n> \n> As a hint how to start: Junio dreamt of a git-clone which is a tiny \n> wrapper around git-fetch and git-remote.\n> \n> So you could start by writing a script which would be a \n> replacement for \n> git-clone.sh, and there you can also include the support for \n> -b that you \n> would like so much.\n> \n> It would be nice, though, to keep this in separate patches, \n> which you then \n> submit to this list.\n> \n> Thank you,\n> Dscho\n\nThank you for these words of visdom, I should know better\nthan to throw out ideas like this. Next time I have an suggestion\nI will think long and hard about it before posting again. \n\n Jocke \n"},{"id":"55420","messageId":"011c01c80b85$a0d8d560$04ac10ac@Jocke","threadId":"10235","inReplyTo":"alpine.LFD.0.999.0710101236350.20690@woody.linux-foundation.org","subject":"RE: [FEATURE REQUEST] git clone, just clone selected branches?","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2007-10-10T21:36:33Z","receivedAt":"2007-10-10T21:36:33Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":"> -----Original Message-----\n> From: Linus Torvalds [mailto:torvalds@linux-foundation.org] \n> Sent: den 10 oktober 2007 21:38\n> To: Joakim Tjernlund\n> Cc: git@vger.kernel.org\n> Subject: Re: [FEATURE REQUEST] git clone, just clone selected \n> branches?\n> \n> \n> \n> On Wed, 10 Oct 2007, Joakim Tjernlund wrote:\n> > \n> > I know I can use git remote to do this, but it is a bit clumsy \n> > when starting a new repo.\n> \n> How about just\n> \n> \tgit init\n> \t.. set up remote tracking info in .git/config ..\n> \tgit fetch remote\n> \n> which should do what you want.\n> \n> \t\tLinus\n\n>From git remote man page:\n o  Imitate git clone but track only selected branches\n\n          $ mkdir project.git\n          $ cd project.git\n          $ git init\n          $ git remote add -f -t master -m master origin git://example.com/git.git/\n          $ git merge origin\n\nyes, this does the trick too but that is more to type so I thought\nit would be simpler if I could just tell git clone which branches I want.\nNow, this isn't a killer feature to me so if you don't like it, I good\nwith that too.\n\n Jocke\n"},{"id":"55427","messageId":"Pine.LNX.4.64.0710102254340.4174@racer.site","threadId":"10235","inReplyTo":"011b01c80b84$222d1e70$04ac10ac@Jocke","subject":"RE: [FEATURE REQUEST] git clone, just clone selected branches?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-10T21:56:31Z","receivedAt":"2007-10-10T21:56:31Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 10 Oct 2007, Joakim Tjernlund wrote:\n\n> I should know better than to throw out ideas like this. Next time I have \n> an suggestion I will think long and hard about it before posting again.\n\nHey, it was just a try.\n\nPersonally, I am not interested in the feature _you_ asked for, but I \nthought it might be pretty easy for you to rewrite git-clone.sh to take \nadvantage of git-fetch and git-remote, and that your desired feature would \nbe easier to add then.  So easy that the whole thing would have taken you \nall of an hour or so.\n\nBut maybe somebody else is interested enough to scratch your itch.\n\nCiao,\nDscho\n"},{"id":"55430","messageId":"011d01c80b8e$b0c0dc30$04ac10ac@Jocke","threadId":"10235","inReplyTo":"Pine.LNX.4.64.0710102254340.4174@racer.site","subject":"RE: [FEATURE REQUEST] git clone, just clone selected branches?","fromName":"Joakim Tjernlund","fromEmail":"joakim.tjernlund@transmode.se","sentAt":"2007-10-10T22:41:25Z","receivedAt":"2007-10-10T22:41:25Z","isPatch":false,"sender":{"key":"joakim.tjernlund@transmode.se","avatar":null},"body":"> -----Original Message-----\n> From: Johannes Schindelin [mailto:Johannes.Schindelin@gmx.de] \n> \n> Hi,\n> \n> On Wed, 10 Oct 2007, Joakim Tjernlund wrote:\n> \n> > I should know better than to throw out ideas like this. \n> Next time I have \n> > an suggestion I will think long and hard about it before \n> posting again.\n> \n> Hey, it was just a try.\n\nSome people might get scared away from such tries\n\n> \n> Personally, I am not interested in the feature _you_ asked for, but I \n\nNP, if it only me that is interested then this is probably not such a good idea.\n\n> thought it might be pretty easy for you to rewrite \n> git-clone.sh to take \n> advantage of git-fetch and git-remote, and that your desired \n> feature would \n> be easier to add then.  So easy that the whole thing would \n> have taken you \n> all of an hour or so.\n\nWell, now I had to take a look and I think you are overestimating my capabilities :)\nIt is a 12KB script full of git-plumbing I have never used, nor do I do\nsh scripts well. It might be an hour for you, but I would probably have\nto spend the whole day :)\n\n Jocke\n> \n> But maybe somebody else is interested enough to scratch your itch.\n> \n> Ciao,\n> Dscho\n> \n> \n> \n"},{"id":"55433","messageId":"Pine.LNX.4.64.0710110000420.4174@racer.site","threadId":"10235","inReplyTo":"011d01c80b8e$b0c0dc30$04ac10ac@Jocke","subject":"RE: [FEATURE REQUEST] git clone, just clone selected branches?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-10-10T23:01:41Z","receivedAt":"2007-10-10T23:01:41Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 11 Oct 2007, Joakim Tjernlund wrote:\n\n> > -----Original Message-----\n> > From: Johannes Schindelin [mailto:Johannes.Schindelin@gmx.de] \n> > \n> > thought it might be pretty easy for you to rewrite git-clone.sh to \n> > take advantage of git-fetch and git-remote, and that your desired \n> > feature would be easier to add then.  So easy that the whole thing \n> > would have taken you all of an hour or so.\n> \n> Well, now I had to take a look and I think you are overestimating my \n> capabilities :) It is a 12KB script full of git-plumbing I have never \n> used, nor do I do sh scripts well. It might be an hour for you, but I \n> would probably have to spend the whole day :)\n\nHeh.  git-clone is pretty crowded.  But it predates git-remote.  And I \nhave a hunch that git-clone will be a trivial script when it calls \ngit-remote and the git-fetch.\n\nCiao,\nDscho\n"},{"id":"55457","messageId":"470DEA6E.5020107@op5.se","threadId":"10235","inReplyTo":"011c01c80b85$a0d8d560$04ac10ac@Jocke","subject":"Re: [FEATURE REQUEST] git clone, just clone selected branches?","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2007-10-11T09:18:38Z","receivedAt":"2007-10-11T09:18:38Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Joakim Tjernlund wrote:\n>> -----Original Message-----\n>> From: Linus Torvalds [mailto:torvalds@linux-foundation.org] \n>> Sent: den 10 oktober 2007 21:38\n>> To: Joakim Tjernlund\n>> Cc: git@vger.kernel.org\n>> Subject: Re: [FEATURE REQUEST] git clone, just clone selected \n>> branches?\n>>\n>>\n>>\n>> On Wed, 10 Oct 2007, Joakim Tjernlund wrote:\n>>> I know I can use git remote to do this, but it is a bit clumsy \n>>> when starting a new repo.\n>> How about just\n>>\n>> \tgit init\n>> \t.. set up remote tracking info in .git/config ..\n>> \tgit fetch remote\n>>\n>> which should do what you want.\n>>\n>> \t\tLinus\n> \n> From git remote man page:\n>  o  Imitate git clone but track only selected branches\n> \n>           $ mkdir project.git\n>           $ cd project.git\n>           $ git init\n>           $ git remote add -f -t master -m master origin git://example.com/git.git/\n>           $ git merge origin\n> \n> yes, this does the trick too but that is more to type so I thought\n> it would be simpler if I could just tell git clone which branches I want.\n> Now, this isn't a killer feature to me so if you don't like it, I good\n> with that too.\n> \n\nWell, that's how git-clone should probably look, now that git-remote exists.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"}]}