git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeffrey Walton <noloader@gmail.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Git List <git@vger.kernel.org>
Subject: Re: Why won't git checkout a branch?
Date: Wed, 1 Jul 2020 06:45:25 -0400	[thread overview]
Message-ID: <CAH8yC8=SgS1=mpSM_7j8FQzreVPfE5U_tnsCz9ixZoBHLUuM7A@mail.gmail.com> (raw)
In-Reply-To: <87lfk3czae.fsf@igel.home>

On Wed, Jul 1, 2020 at 6:20 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> On Jul 01 2020, Jeffrey Walton wrote:
>
> > On Wed, Jul 1, 2020 at 5:50 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
> >>
> >> On Jul 01 2020, Jeffrey Walton wrote:
> >>
> >> > $ git checkout m4
> >>
> >> Try a newer git version:
> >>
> >> $ git checkout m4
> >> fatal: 'm4' could be both a local file and a tracking branch.
> >> Please use -- (and optionally --no-guess) to disambiguate
> >
> > Ack, thanks.
> >
> > This does not look normal, either. I don't want to create a new
> > branch. I want to work on the existing branch.
>
> To disambiguate, use `git checkout m4 --' if you want the branch, and
> `git checkout -- m4' if you want the local file.

Perfect, thanks.

So the way to checkout that always works is to append --. Is that correct?

If so, I will start using it everywhere.

Jeff

  reply	other threads:[~2020-07-01 10:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01  8:41 Why won't git checkout a branch? Jeffrey Walton
2020-07-01  9:50 ` Andreas Schwab
2020-07-01 10:09   ` Jeffrey Walton
2020-07-01 10:20     ` Andreas Schwab
2020-07-01 10:45       ` Jeffrey Walton [this message]
2020-07-01 15:13     ` Chris Torek

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH8yC8=SgS1=mpSM_7j8FQzreVPfE5U_tnsCz9ixZoBHLUuM7A@mail.gmail.com' \
    --to=noloader@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=schwab@linux-m68k.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).