Is there any way to config Git to reject a merge if the action will result in a detached HEAD?
I know how to solve the detached HEAD, but I would rather have git to reject the merge-action to avoid the detached HEAD entirely.
The issue occurs when this happens:
- I am working on a
develop
branch in the main repo and I also comitted some changes in a submodule repository. Thedevelop
branch is updated to match the newest commit of the submodule. - A colleague wants to merge
develop
into themaster
, but forgets to pull the submodule onmaster
first. This results in a detached HEAD.