A HEAD is the end of that line. A detached head is when you have checked out a sha that isn’t the end.
This isn’t quite a right. I hope my clarification is helpful!
HEAD is the ref that you currently have checked out. This could be a commit ID, a branch ID, etc., and there may be multiple refs that point to the same commit.
When you check out a commit ID directly, you’re in a “detached HEAD” state because you aren’t on a branch. This is noteworthy because it means that any commits you make will be untracked by any branch, and will only be available in the reflog.
Trying to keep it simple for folks. Yes, we are talking about local - checked out code - head is the marker for knowing where you are. On tree or off. A git reset —hard head will bring you back to that end-of-line for that branch of the tree. I’m not going to go into multi-headed merges.
Comments
This isn’t quite a right. I hope my clarification is helpful!
HEAD is the ref that you currently have checked out. This could be a commit ID, a branch ID, etc., and there may be multiple refs that point to the same commit.
When you check out a commit ID directly, you’re in a “detached HEAD” state because you aren’t on a branch. This is noteworthy because it means that any commits you make will be untracked by any branch, and will only be available in the reflog.
Trying to keep it simple for folks. Yes, we are talking about local - checked out code - head is the marker for knowing where you are. On tree or off. A git reset —hard head will bring you back to that end-of-line for that branch of the tree. I’m not going to go into multi-headed merges.