Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: master^ is not a local branch -- huh?!?

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:08

Possibly related (same subject, not in this thread)

Nicolas Pitre [off-list ref] writes:
What purpose does this "feature" serve?  Making sure people remain 
stupid and get even more confused when the special dwimery doesn't work 
because they don't know the difference between a local branch and a 
remote tracking branch?

And now people will be left wondering why after a fetch they don't get 
the latest stuff when they do "git checkout topic" again.  Is this any 
better?
Sverre's explanation does not match reality.

We used to just say "topic is not a rev nor path" and failed when the user
said "git checkout topic".  And the magic kicks in when there is only one
"remotes/*/topic".

Because this cannot be any request other than to check out a local branch
"topic", and because there is no place more sensible than the "topic"
taken from the "origin" (as that is the sole place that has "topic"), it
dwims as a shorthand for "checkout -b topic origin/topic" and tells you
that it did so.

So people _has_ to still know that local branches are the only thing they
can check out (iow, "checkout topic" is not a request to check out a
remote tracking branch).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help