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.
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.
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>
git checkout <commit_id>
but it doesn't recognize any remote branches. Trying to checkout another branch gives the same error as trying to get a new commit. pathspec <branch name or commit_id> did not match any file(s) known to git
–
Gifford © 2022 - 2024 — McMap. All rights reserved.