git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Angelo Borsotti <angelo.borsotti@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: git checkout error
Date: Tue, 09 Oct 2012 11:36:12 +0200	[thread overview]
Message-ID: <m2lifg7zsj.fsf@igel.home> (raw)
In-Reply-To: <CAB9Jk9DUEL_J3MmH_4k7NC82m+crpCf1r3NS3gQBMZy+kvY3-A@mail.gmail.com> (Angelo Borsotti's message of "Tue, 9 Oct 2012 09:41:38 +0200")

Angelo Borsotti <angelo.borsotti@gmail.com> writes:

> If they are specified after -b, the command seems to behave as if -b
> was not specified, e.g.:
>
> $ git checkout -b --no-track topic remotes/origin/master

-b requires an argument <new_branch>, which you specify as --no-track
here.  <start_point> is topic, and the rest is interpreted as <paths>.

> fatal: git checkout: updating paths is incompatible with switching branches.

This error is detected before validating <new_branch>.

> while if they are specified before -b the command behaves properly, e.g.
>
> $ git checkout --no-track -b topic remotes/origin/master
> Switched to a new branch 'topic'

You can also specify --no-track after -b (and its argument):

$ git checkout -b topic --no-track remotes/origin/master

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2012-10-09  9:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09  7:41 git checkout error Angelo Borsotti
2012-10-09  9:36 ` Andreas Schwab [this message]
2012-10-09 17:55   ` Junio C Hamano
2012-10-09 23:25   ` Angelo Borsotti
2012-10-09 23:47     ` Junio C Hamano
2012-10-10  7:02       ` Angelo Borsotti
2012-10-10  7:40         ` Junio C Hamano
2012-10-10  8:52           ` Angelo Borsotti

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=m2lifg7zsj.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=angelo.borsotti@gmail.com \
    --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).