Git pre-commit hooks break `git merge` (with conflicts)
Hey, Jan Winkelmann here. Miriam asked me to debug a git issue, and I think this is not intended behaviour.
Git merges do not work:
git checkout kerker git merge develop [...] resolve conflicts git commit -m "Commit Message"
with the output:
fatal: could not open '.git/MERGE_HEAD' for reading: No such file or directory
It appears the problem is the pre-commit hook. Specifically, stashing as part of the hook destroys the MERGE_HEAD file. See related StackOverflow thread here: https://stackoverflow.com/questions/27800512/bypass-pre-commit-hook-for-merge-commits
The short of it is: Either detect in the hook that the current commit is a merge and then don't do the check, Or remember to use --no-verify for all merges.