git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Odd error when doing "clone && cd && checkout -b"
@ 2010-02-03  7:00 Jacob Helwig
  2010-02-03  7:40 ` Johannes Sixt
  0 siblings, 1 reply; 3+ messages in thread
From: Jacob Helwig @ 2010-02-03  7:00 UTC (permalink / raw)
  To: Git

In talking with someone in the IRC channel, I ran across something that
I thought was very odd behavior.  I'm sure there's a very simple
explanation, but I can't think of what it might be.

The person was getting "fatal: git checkout: updating paths is
incompatible with switching branches.", when they tried to create a new
tracking branch, and switch to it, with a fresh clone.  I was able to
reproduce this, but only by one-lining the "clone && cd && checkout -b".

When the "checkout -b" fails from the one-lined version, immediately
doing the "checkout -b" on its own succeeds.

The output below is from zsh (4.3.10), however I get the exact same
behavior when I run the commands using bash (4.0.33).  I was testing
this using Git 1.6.6.1.598.g661e2.

== One-lined Version ==

vfb-9 ~/tmp % git clone git://github.com/rich97/CakeCMP.git && cd CakeCMP && git checkout -b permissions-rewrite origin/permissions-rewrite
Initialized empty shared Git repository in /home/jhe/tmp/CakeCMP/.git/   
remote: Counting objects: 1508, done.
remote: Compressing objects: 100% (1432/1432), done.
remote: Total 1508 (delta 256), reused 1235 (delta 60)
Receiving objects: 100% (1508/1508), 844.43 KiB | 104 KiB/s, done.
Resolving deltas: 100% (256/256), done.
fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'origin/permissions-rewrite' which can not be resolved as commit?

vfb-9 ~/tmp/CakeCMP on master(a026490) sigexit % git checkout -b permissions-rewrite origin/permission-rewrite
Branch permissions-rewrite set up to track remote branch permission-rewrite from origin.
Switched to a new branch 'permissions-rewrite'

== Running "checkout -b" on its own ==

vfb-9 ~/tmp % git clone git://github.com/rich97/CakeCMP.git && cd CakeCMP
Initialized empty shared Git repository in /home/jhe/tmp/CakeCMP/.git/
remote: Counting objects: 1508, done.
remote: Compressing objects: 100% (1432/1432), done.
remote: Total 1508 (delta 256), reused 1235 (delta 60)
Receiving objects: 100% (1508/1508), 844.43 KiB | 93 KiB/s, done.
Resolving deltas: 100% (256/256), done.

vfb-9 ~/tmp/CakeCMP on master(a026490) % git checkout -b permissions-rewrite origin/permission-rewrite
Branch permissions-rewrite set up to track remote branch permission-rewrite from origin.
Switched to a new branch 'permissions-rewrite'

vfb-9 ~/tmp/CakeCMP on permissions-rewrite(ca687f1) % git --version
git version 1.6.6.1.598.g661e2

-Jacob

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Odd error when doing "clone && cd && checkout -b"
  2010-02-03  7:00 Odd error when doing "clone && cd && checkout -b" Jacob Helwig
@ 2010-02-03  7:40 ` Johannes Sixt
  2010-02-03 13:25   ` Jacob Helwig
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Sixt @ 2010-02-03  7:40 UTC (permalink / raw)
  To: Jacob Helwig; +Cc: Git

Jacob Helwig schrieb:
> vfb-9 ~/tmp % git clone git://github.com/rich97/CakeCMP.git && cd CakeCMP && git checkout -b permissions-rewrite origin/permissions-rewrite
> Initialized empty shared Git repository in /home/jhe/tmp/CakeCMP/.git/   
> remote: Counting objects: 1508, done.
> remote: Compressing objects: 100% (1432/1432), done.
> remote: Total 1508 (delta 256), reused 1235 (delta 60)
> Receiving objects: 100% (1508/1508), 844.43 KiB | 104 KiB/s, done.
> Resolving deltas: 100% (256/256), done.
> fatal: git checkout: updating paths is incompatible with switching branches.
> Did you intend to checkout 'origin/permissions-rewrite' which can not be resolved as commit?

Or did you intend to track 'origin/permission-rewrite' instead ;-)

-- Hannes

PS: Please don't set Mail-Followup-To for this list.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Odd error when doing "clone && cd && checkout -b"
  2010-02-03  7:40 ` Johannes Sixt
@ 2010-02-03 13:25   ` Jacob Helwig
  0 siblings, 0 replies; 3+ messages in thread
From: Jacob Helwig @ 2010-02-03 13:25 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Git

On Tue, Feb 2, 2010 at 23:40, Johannes Sixt <j.sixt@viscovery.net> wrote:
> Jacob Helwig schrieb:
>> vfb-9 ~/tmp % git clone git://github.com/rich97/CakeCMP.git && cd CakeCMP && git checkout -b permissions-rewrite origin/permissions-rewrite
>> Initialized empty shared Git repository in /home/jhe/tmp/CakeCMP/.git/
>> remote: Counting objects: 1508, done.
>> remote: Compressing objects: 100% (1432/1432), done.
>> remote: Total 1508 (delta 256), reused 1235 (delta 60)
>> Receiving objects: 100% (1508/1508), 844.43 KiB | 104 KiB/s, done.
>> Resolving deltas: 100% (256/256), done.
>> fatal: git checkout: updating paths is incompatible with switching branches.
>> Did you intend to checkout 'origin/permissions-rewrite' which can not be resolved as commit?
>
> Or did you intend to track 'origin/permission-rewrite' instead ;-)
>
> -- Hannes
>
> PS: Please don't set Mail-Followup-To for this list.
>

Well, I _thought_ I had used the exact same command for the "checkout
-b".  Obviously, this is not the case.  Bah.  That's what I get for
trying to do anything so late.

Apparently Mutt defaults to setting the Mail-Followup-To, if you've let
it know about a list.  Anyway...that's been fixed.

-Jacob

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-03 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-03  7:00 Odd error when doing "clone && cd && checkout -b" Jacob Helwig
2010-02-03  7:40 ` Johannes Sixt
2010-02-03 13:25   ` Jacob Helwig

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).