Re: user manual question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2008-12-29, Zorba <cr@xxxxxxxxxxxxx> wrote:
> so a detached HEAD is just a HEAD that is not sitting on a tip ?

yes...

> i.e. if I do $ git reset --hard HEAD^
>
> ...pointing HEAD to the previous committ
>
> this is a detached HEAD

...but no.  This is because git reset moves the tip of the
branch also (in this case, backward by one commit from the
previous).  In effect, you're saying "discard my latest
commit and roll back by one".

"git checkout HEAD^" would get you a detached head though.
In this case you're saying "let the branch be where it is,
but let HEAD move up one level".  So HEAD is now NOT at a
tip, and it'a a detached head.

It's instructive to run "gitk --all" when you're doing these
experiments sometimes.

> (I thought a detached HEAD was maybe a head somewhere on another branch not 
> "reachable", i.e. a sibling, not a ancestor...
> or something like that)

no no that's just another branch that's all.

All this is pretty confusing in the beginning, but if you
don't lose your head, it'll all become clear eventually.

[What's that they say?  Oh yeah "thank you ladies and
gentlemen I'll be here all night"!]

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux