Then we would not be talking about detached HEAD at all. Why
not require users to name the branch if they want to check out
what they should not be able to in the first place?
Convenience.
Some features of git are about being convenient by allowing you
to defer the decision. You can start mucking with the working
tree files without knowing where it leads to and then from that
point with the dirty working tree state decide to fork what you
have started using "checkout -b newbranch". Even though you may
have many dirty files in the working tree, you can selectively
update index (especially with the patch subcommand of the
interactive git-add) to prepare for commit -- you do not choose
what to edit, but you defer the decision of what to include in
the commit.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html