git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git checkout error

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 9, 2012, 17:55 UTC
Message-ID
<7vzk3vfs2m.fsf@alter.siamese.dyndns.org>
In-Reply-To
<m2lifg7zsj.fsf@igel.home>
Andreas Schwab <schwab@linux-m68k.org> writes:
Show 22 quoted lines
> 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
Isn't this "asked and answered" recently with this thread?
    http://thread.gmane.org/gmane.comp.version-control.git/204397
Previous: Andreas SchwabNext: Angelo Borsotti
Message 3 of 8 in “git checkout error”
  1. Angelo BorsottiOct 9, 2012
  2. Andreas SchwabOct 9, 2012
  3. Junio C HamanoOct 9, 2012
  4. Angelo BorsottiOct 9, 2012
  5. Junio C HamanoOct 9, 2012
  6. Angelo BorsottiOct 10, 2012
  7. Junio C HamanoOct 10, 2012
  8. Angelo BorsottiOct 10, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.