A client side solution is using git pre-commit hooks which allow you to execute specific commands when you commit (a merge is a type of commit) and if they fail, then you cannot merge until it's resolved.
pre-commit is a simple way and standardised to manage git pre-commit hooks.
In the root of your repository create a file called .pre-commit-config.yaml With the following
# See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.0.1 hooks: - id: check-merge-conflict
Install pre-commit
(preferred way is to) use pipx or do this outside a virtual env since it's a CLI application
python3 -m pip install pre-commit
Install the hooks
pre-commit install # you only do this once per "git clone"
Next time you merge if there are conflict markers detected it will warn you and prevent you from continuing
$ git merge --continue [INFO] Checking merge-conflict files only. Check for merge conflicts................................................Failed - hook id: check-merge-conflict - exit code: 1 Merge conflict string "<<<<<<< " found in README.rst:1 Merge conflict string "======= " found in README.rst:3 Merge conflict string ">>>>>>> " found in README.rst:5
git rev-parse -q --verify HEAD && sed -n '/^<<<<<<< /Q1' $(git diff --diff-filter=M --name-only HEAD $(git write-tree)) || { echo "It looks like rain."; exit 1; }to.git/hooks/pre-commit. That's keyboard-to-editbox but it should be substantially correct.