Right now I again committed to a git submodule without checking out master
(or any other branch) before:
╭─some@machine ~/some/poject/submodules/coollib ‹cbc6ecc*›
╰─$ git commit -am"some message"
[detached HEAD 0538b11] some message
2 files changed, 13 insertions(+), 2 deletions(-)
Maybe my way of working with git is just amateurish but I think I now have to either undo that commit and checkout e.g. master
and re-commit or create a branch and merge back to the branch I wanted to commit to.
To me commiting to an unnamed snapshot looks like a low-level procedure which should at least be warned about (if not forbidden)
Why is it allowed to commit to a detached HEAD? When can this be useful?
And can git
's behavior be changed via global options?