Reputation: 6171
git status
says:
HEAD detached at e1997bd
and git rev-parse HEAD
says:
e1997bd
What's the meaning of this?
I was thinking HEAD detached means HEAD is not pointing to to branch tip.
Upvotes: 11
Views: 8692
Reputation: 10566
Read through: http://gitolite.com/detached-head.html
You can also look at: http://gitolite.com/gcs.html#(48)
The head points to the commit, that's not the problem. The problem is that it's no longer a reference to a local branch name. It's the actual SHA1 hash of the commit.
This may have happened if you did:
git checkout <commit_id>
-- or --
git checkout origin/master
To fix this, do
git checkout <branch_name>
Upvotes: 18