{"thread":{"id":"20167","subject":"clone","startedAt":"2009-07-20T14:33:51Z","lastAt":"2009-07-21T09:56:02Z","messageCount":4,"participants":["Roald de Vries","Jeff King","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"118316","messageId":"D229D90E-0294-475D-B7AC-6C7B23CC169A@roalddevries.nl","threadId":"20167","inReplyTo":null,"subject":"clone","fromName":"Roald de Vries","fromEmail":"rdv@roalddevries.nl","sentAt":"2009-07-20T14:33:51Z","receivedAt":"2009-07-20T14:33:51Z","isPatch":false,"sender":{"key":"rdv@roalddevries.nl","avatar":null},"body":"Dear all,\n\nIf I clone a repository with multiple branches to 'newdir', and then  \ntype 'git branch' in 'newdir', I see only 1 branch. 'git branch -r'  \ngives me all branches. Is that correct behaviour? If so, why? And  \nmainly: can I configure git to clone all original branches to non- \nremote branches?\n\nKind regards, Roald\n"},{"id":"118322","messageId":"20090720152407.GC5347@coredump.intra.peff.net","threadId":"20167","inReplyTo":"D229D90E-0294-475D-B7AC-6C7B23CC169A@roalddevries.nl","subject":"Re: clone","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-07-20T15:24:07Z","receivedAt":"2009-07-20T15:24:07Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jul 20, 2009 at 04:33:51PM +0200, Roald de Vries wrote:\n\n> If I clone a repository with multiple branches to 'newdir', and then\n> type 'git branch' in 'newdir', I see only 1 branch. 'git branch -r'\n> gives me all branches. Is that correct behaviour? If so, why? And\n> mainly: can I configure git to clone all original branches to non-\n> remote branches?\n\nYes, it's correct. You really only need local branches of things you are\ngoing to work on. And then that happens, you generally would just \"git\ncheckout -b foo origin/foo\" to make your own local \"foo\" branch that you\nwill be working on (or if you are using topic branches, something more\nlike \"git checkout -b mytopic origin/master\"). If you are just\ninspecting branches (e.g., checking them out to try building, doing\ndiffs against them, using them as reference points for logging, etc),\nthen the remote versions are fine.\n\n-Peff\n"},{"id":"118359","messageId":"4A6576B3.7000503@drmicha.warpmail.net","threadId":"20167","inReplyTo":"D229D90E-0294-475D-B7AC-6C7B23CC169A@roalddevries.nl","subject":"Re: clone","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-07-21T08:05:07Z","receivedAt":"2009-07-21T08:05:07Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Roald de Vries venit, vidit, dixit 20.07.2009 16:33:\n> Dear all,\n> \n> If I clone a repository with multiple branches to 'newdir', and then  \n> type 'git branch' in 'newdir', I see only 1 branch. 'git branch -r'  \n> gives me all branches. Is that correct behaviour? If so, why? And  \n> mainly: can I configure git to clone all original branches to non- \n> remote branches?\n> \n> Kind regards, Roald\n\nA for the 2nd part (1st one answered by Jeff), you can \"git clone --mirror\".\n\nBut me suspects that you actually want (s)cp -rp, do you?\n\nMichael\n"},{"id":"118363","messageId":"0884A878-A57C-4089-AE32-A3D1ACC32FED@roalddevries.nl","threadId":"20167","inReplyTo":"4A6576B3.7000503@drmicha.warpmail.net","subject":"Re: clone","fromName":"Roald de Vries","fromEmail":"rdv@roalddevries.nl","sentAt":"2009-07-21T09:56:02Z","receivedAt":"2009-07-21T09:56:02Z","isPatch":false,"sender":{"key":"rdv@roalddevries.nl","avatar":null},"body":"Hi Michael,\n\nI actually meant cloning all branches to both remote and non-remote  \n(but remote-tracking) branches. But still, the --mirrorring is  \nusefull, thx.\n\nKind regards, Roald\n\n\nOn Jul 21, 2009, at 10:05 AM, Michael J Gruber wrote:\n> Roald de Vries venit, vidit, dixit 20.07.2009 16:33:\n>> Dear all,\n>>\n>> If I clone a repository with multiple branches to 'newdir', and then\n>> type 'git branch' in 'newdir', I see only 1 branch. 'git branch -r'\n>> gives me all branches. Is that correct behaviour? If so, why? And\n>> mainly: can I configure git to clone all original branches to non-\n>> remote branches?\n>>\n>> Kind regards, Roald\n>\n> A for the 2nd part (1st one answered by Jeff), you can \"git clone -- \n> mirror\".\n>\n> But me suspects that you actually want (s)cp -rp, do you?\n>\n> Michael\n>\n"}]}