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

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

From: Nicolas Pitre <nico@fluxnic.net>
Date: 2016-06-15 22:48:08

Possibly related (same subject, not in this thread)

On Fri, 29 Jan 2010, Sverre Rabbelier wrote:
Heya,

On Fri, Jan 29, 2010 at 22:29, Nicolas Pitre [off-list ref] wrote:
quoted
Then who was arguing about making Git more user friendly rather
then less?
Using a detached head is a more advanced feature than wanting to
checkout a remote branch locally, creating a local tracking branch. As
such, 'git checkout origin/topic' now means the same as 'git checkout
-t origin/topic', and you can get the old behavior back by doing 'git
checkout origin/topic^0'.
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?
I don't see what the problem is, if you're
using a detached head you're an advanced enough git user that you can
remember that you can use '^0' to detach your head.
I don't agree with the assertion that a detached HEAD is for advanced 
users only.
It's not all that uncommon to do 'git checkout HEAD^0' to detach your 
head to the current branch, no?
Certainly way more uncommon than 'git checkout origin/foo', and way less 
intuitive.


Nicolas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help