How resolve multiple conflicts with “git mergetool” without having to close the editor between files?

At first glance, it does not seem possible to reuse an external diff tool session.

The git-mergetool documentation clearly states:

If the custom merge tool correctly indicates the success of a merge resolution with its exit code, then the configuration variable mergetool.<tool>.trustExitCode can be set to true.
Otherwise, git-mergetool will prompt the user to indicate the success of the resolution after the custom tool has exited.

So the exit code (or the validation of the user after the exit of the diff tool) is needed, implying that the user first close the external diff tool.

That seems a great incentive to reduce the number of conflicts on each merge/rebase one attempts 😉 (whatever the VCScs tool used)

Note:
Two other git external diff tools settings (“Setting up diff and merge tools for Git on Windows” and “Setting up SourceGear DiffMerge with Git“) do not give more hopes when it come to not closing the external diff tool…

Leave a Comment