From: John Tapsell Date: Thu, 12 Mar 2009 11:48:31 GMT Subject: Re: git checkout -b origin/mybranch origin/mybranch Message-ID: <43d8ce650903120448x51220ba0k660be7706acba755@mail.gmail.com> In-Reply-To: 2009/3/12 Johannes Schindelin : > Hi, > > On Thu, 12 Mar 2009, John Tapsell wrote: > >>   One of my collegues did: >> >> git checkout origin/somebranch >> >>   git complained that they need to specify the name with -b.  So they did: >> >> git checkout -b origin/somebranch origin/somebranch > > Yeah, a pilot error.  It should have been > >        $ git checkout -t origin/somebranch Maybe the error message for "git checkout origin/somebranch" should suggest: git checkout -t origin/somebranch? > I have to wonder, though, why "git checkout origin/somebranch" did not > detach your HEAD. It did. But that doesn't affect doing "git checkout -b origin/somebranch origin/somebranch" afterwards. >>   Git accepts this with no problems, but boy - all hell broke loose. >> Doing a push or pull gave errors, because "origin/somebranch" is now >> ambigous (since there is two of them). > > I strongly doubt that it gave errors, but rather warnings.  I have a > repository where I get warnings all the time (it has a cvsimport and an > origin remote), but it works without problems. > >>  They can't even:  "git checkout -b somebranch origin/somebranch" >> anymore, since "origin/somebranch" is ambigous.  It all got into a mess. > > I wonder why you did not just "git branch -m somebranch". Because they didn't know what on earth was going on, and git was spitting out errors everywhere, they were afraid git would crash. John