I guess that git does not let you commit on a detached head without
crying out loud.
For some definition of "crying out loud" only ;-)
$ git branch
* (no branch)
master
$ git commit -a -m foo
[detached HEAD b27b4e3] foo
1 files changed, 1 insertions(+), 2 deletions(-)
--
Matthieu