Re: git checkout -b origin/mybranch origin/mybranch
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 12, 2009, 11:43 UTC
- Message-ID
- <alpine.DEB.1.00.0903121240400.10279@pacific.mpi-cbg.de>
- In-Reply-To
- <43d8ce650903120436u261cb7e3p838e4a12e7b54d7d@mail.gmail.com>
Hi,
On Thu, 12 Mar 2009, John Tapsell wrote:
Show 7 quoted lines
> 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
I have to wonder, though, why "git checkout origin/somebranch" did not detach your HEAD.
> 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".
Ciao, Dscho