Is there a way to configure git merge in such a way that conflict resolution always goes through an external merge tool?
I'm writing the configuration for semanticmerge and there are cases like this that are incorrectly handled by git but can be correctly solved by semanticmerge: * two developers added the same method on two different locations of the same file.
The problem is that git merge says the conflict is automatic so git mergetool can't be invoked.
Thanks.
See the documentation of gitattributes. Deep down is an attribute called, "merge" that sets the merge method for matching files.
As such, for example, you could have a
.gitattributes
file in the root of the project that contains,which will use the
filfre
program to merge. It calls the program withThe merge driver is expected to overwrite %A with the result of the merge in the merge.
There is a section in that documentation, headed by "Defining a custom merge driver," that suggests, for globally setting the merge tool
placed in your git configuration, for example,
.git/config
or$HOME/.gitconfig
.