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

Re: user manual question

From: Sitaram Chamarty <hidden>
Date: 2016-06-15 22:45:50

On 2008-12-29, Zorba [off-list ref] 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"!]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help