Skip to main content


You are in 'detached HEAD' state.
You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch.
Commander Data in the TNG episode "Disaster" when he has head removed. His head is sitting on a console observing something and he has wires coming out of the back of it
working on detached HEAD is a great way to avoid creating local branches. I don't need them anyway. Been working like this for years.
Oh this state drives me crazy when I'm coding; it's a valid state nothing wrong, but trying to get out of it...
@Andrew Leer @fraggle I'm under no illusion about git's usability, the error message is not awesome and neither are the commands to get into a named branch, but if you've been in this state more than once unwillingly, the way out is literally one checkout command, regardless if you want to name your current state and make it a branch or you want to discard it and switch to an existing branch.
And I'm always confused how it happened
this is when I just nuke the repo and start over
⇧