From: John Tapsell <johnflux@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Git List <git@vger.kernel.org>
Subject: Re: git checkout -b origin/mybranch origin/mybranch
Date: Thu, 12 Mar 2009 13:18:21 +0000 [thread overview]
Message-ID: <43d8ce650903120618h79686207vaa478c54f34e26f8@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0903121357320.6335@intel-tinevez-2-302>
2009/3/12 Johannes Schindelin <Johannes.Schindelin@gmx.de>:
> Hi,
>
> On Thu, 12 Mar 2009, John Tapsell wrote:
>
>> 2009/3/12 Johannes Schindelin <Johannes.Schindelin@gmx.de>:
>>
>> > 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.
>
> So did the warning read something like this?
>
> -- snip --
> moving to "d36a18dc9cdf1dfce8632e42491b826387aa3230" which isn't a local
> branch
> If you want to create a new branch from this checkout, you may do so
> (now or later) by using -b with the checkout command again. Example:
> git checkout -b <new_branch_name>
> -- snap --
>
> ?
I'm really not sure what point you're trying to prove. Yes, we all
know that the user made a mistake in thinking that the new_branch_name
should be "origin/mybranch".
What I'm suggesting is that git tries to not let the user shoot
himself in the foot so easily.
I'm saying that:
git checkout -b origin/mybranch origin/mybranch
Is probably a mistake by the user. We should warn the user and point
them in the right direction.
John
next prev parent reply other threads:[~2009-03-12 13:19 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-12 11:36 git checkout -b origin/mybranch origin/mybranch John Tapsell
2009-03-12 11:40 ` Sverre Rabbelier
2009-03-12 11:43 ` Johannes Schindelin
2009-03-12 11:48 ` John Tapsell
2009-03-12 13:02 ` Johannes Schindelin
2009-03-12 13:18 ` John Tapsell [this message]
2009-03-12 13:43 ` Sverre Rabbelier
2009-03-12 14:14 ` John Tapsell
2009-03-13 14:08 ` Michael J Gruber
2009-03-12 15:21 ` Pieter de Bie
2009-03-12 15:37 ` Jeff King
2009-03-12 16:16 ` John Tapsell
2009-03-12 16:35 ` Jeff King
2009-03-12 16:40 ` Pieter de Bie
2009-03-12 16:51 ` Jeff King
2009-03-12 16:58 ` John Tapsell
2009-03-12 17:14 ` Jeff King
2009-03-12 17:45 ` John Tapsell
2009-03-12 16:45 ` John Tapsell
2009-03-12 18:31 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43d8ce650903120618h79686207vaa478c54f34e26f8@mail.gmail.com \
--to=johnflux@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).