{"thread":{"id":"7597","subject":"git-branch and git-remotes confusion","startedAt":"2007-04-10T12:05:17Z","lastAt":"2007-04-10T12:33:43Z","messageCount":3,"participants":["Martin Langhoff","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"39006","messageId":"46a038f90704100505i7bdd88a8q52186f7ce7ff0cdf@mail.gmail.com","threadId":"7597","inReplyTo":null,"subject":"git-branch and git-remotes confusion","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2007-04-10T12:05:17Z","receivedAt":"2007-04-10T12:05:17Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"Hi,\n\nmaybe I'm daft, or cogito has eaten my brain. The task at hand is\nreally simple: clone from repo X, tracking branch Y (where branch Y !=\nHEAD). The repo is http://git.catalyst.net.nz/git/moodle-r2.git , the\nbranch is mdl18-olpc .\n\nWith cg, this is trivial:\n\n  cg-clone http://git.catalyst.net.nz/git/moodle-r2.git#mdl18-olpc\n\nwhich automagically gives me a \"master\" and \"origin\" pair of heads\nthat do the right thing. Specifically, cg-update does the right thing.\n\nWith git 1.5.x, I managed to figure out that this is wrong. :\n\n  git-clone --origin mdl18-olpc \\\n      http://git.catalyst.net.nz/git/moodle-r2.git\n\nand now I am trying to see if some incantation around this works\n\n   git-clone http://git.catalyst.net.nz/git/moodle-r2.git\n   git-branch --track origin/mdl18-olpc my18-olpc\n\nBut it isn't working, and I'm reading git/Documentation for git-branch\nand git-remote but I can't find it. I don't care about any other\nbranch (though if they are there, fine!). Is there a trivially simple\nanswer.\n\n(Cogito has eaten my brain probably. For a long time I've always\ncloned with cogito just for the sake of this convenience, even if I\nwas going to use git mostly when working with the code. Now I'm\nworking on a server that only has git, so I thought 1.5.x would make\nthis trivial...)\n\ncheers,\n\n\n\nmartin\n"},{"id":"39010","messageId":"20070410122516.GA27388@coredump.intra.peff.net","threadId":"7597","inReplyTo":"46a038f90704100505i7bdd88a8q52186f7ce7ff0cdf@mail.gmail.com","subject":"Re: git-branch and git-remotes confusion","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-04-10T12:25:17Z","receivedAt":"2007-04-10T12:25:17Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Apr 11, 2007 at 12:05:17AM +1200, Martin Langhoff wrote:\n\n>   git-clone http://git.catalyst.net.nz/git/moodle-r2.git\n>   git-branch --track origin/mdl18-olpc my18-olpc\n\nYour arguments to git-branch are backwards. It should be:\n\n  git-branch --track my18-olpc origin/mdl18-olpc\n\nAlso note that --track didn't show up until 1.5.1.  Other than that, it\nshould do what you expect (check out your .git/config before and after\nto see the impact of --track).\n\n-Peff\n"},{"id":"39011","messageId":"46a038f90704100533l7d795e79vd6245445c7e74c67@mail.gmail.com","threadId":"7597","inReplyTo":"20070410122516.GA27388@coredump.intra.peff.net","subject":"Re: git-branch and git-remotes confusion","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2007-04-10T12:33:43Z","receivedAt":"2007-04-10T12:33:43Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 4/11/07, Jeff King <peff@peff.net> wrote:\n> Your arguments to git-branch are backwards. It should be:\n>\n>   git-branch --track my18-olpc origin/mdl18-olpc\n>\n> Also note that --track didn't show up until 1.5.1.  Other than that, it\n> should do what you expect (check out your .git/config before and after\n> to see the impact of --track).\n\nthanks. And I'm reading the doco for 1.5.latest and it turns out I'm\nusing 1.5.0.5 so that won't work either.\n\nhmmm. actually, I'm having another problem that is a bit more serious:\ncloning via http doesn't create a remotes/origin and doesn't perform\nthe initial checkout.\n\nwill post separately about this...\n\n\n\nmartin\n"}]}