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

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

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

On Mon, 1 Feb 2010, Junio C Hamano wrote:
I do not think we need yet another term "scratchpad" for this, but what is
important is that both introductory and full documentation explain the
detached HEAD well.

Currently we say:

    Detached HEAD
    -------------

    It is sometimes useful to be able to 'checkout' a commit that is
    not at the tip of one of your branches.  The most obvious
    example is to check out the commit at a tagged official release
    point, like this:

    ------------
    $ git checkout v2.6.18
    ------------

    Earlier versions of git did not allow this and asked you to
    create a temporary branch using the `-b` option, but starting from
    version 1.5.0, the above command 'detaches' your HEAD from the
    current branch and directly points at the commit named by the tag
    (`v2.6.18` in the example above).

If read carefully (some may argue that it does not need a very careful
reading to get it, though), this hints that "detached HEAD" state is a
substitute for using a temporary branch, but it may not be strong enough.

I thought that a documentation update in this area was already planned?
Jay Soffian (added to CC) agreed to augment the documentation with the 
comprehensive explanation he posted to the list lately.


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