Recovering from a "detached from" HEAD
- From
Alyssa Ross <hi@alyssa.is>
- Date
- Jan 7, 2019, 16:17 UTC
- Message-ID
- <20190107161748.pyhgpewymdgjmgoh@x220>
If I detach my head, then use `git subtree add` to generate a commit, the output from `git status` changes from "detached at SHA" to "detached from SHA". The sha doesn't change, but HEAD has updated.
I don't understand why `git status` doesn't tell me that I'm "detached at" the sha of the new commit, but not only that, it seems to be extremely difficult to get `git status` to reflect my actual HEAD. `git checkout HEAD` doesn't change it, `git checkout NEWSHA` doesn't work.
So my question is, what's going on here? Is this intentional behaviour, or a bug? How should I get my working tree back to a normal state?