I was wrong. Below is my now fixed answer.
After than, I think my HEAD have been changed to that commit.
git checkout
changes your HEAD
and makes your working directory look like the directory represented at the commit you give it, in this case 7748608
. What it does not do is change any branch references. What it means to have a detached HEAD is that your HEAD
ref doesn't point to any branch refs. If you make any commits you will branch away from any other branch history. Here's an example from the git checkout
man page:
$ edit; git add; git commit
HEAD (refers to commit 'e')
|
v
e
/
a---b---c---d branch 'master' (refers to commit 'd')
^
|
tag 'v2.0' (refers to commit 'b')
In this example, the HEAD
was detached to point at b
and then a commit was made (commit e
). Because e
is not referenced by any branch or tag refs, it risks being deleted when the git garbage collector next runs. This is the danger of having a detached HEAD
and is the reason git warns you when you have one.
Back to your question, though:
HEAD detached at 6b90718
This is saying that your HEAD
is detached (it doesn't point at any branch ref) and it's letting you know that your HEAD
is referencing commit 6b90718
. The fact that it's 6b90718
and not 7748608
looks strange, but if you made any commits after the checkout then it makes perfect sense. 7748608
would be like b
in the above example, and 6b90718
would be e
.