Does git combine different types of files with an external tool?

we are working on a project where we often get the same conflict due to the fact that git cannot merge files correctly. However, these conflicts can be easily resolved with an external script. Is it possible to somehow allow git now that it should always handle merge conflicts in a file with a specific extension with an external script? The script needs → → and <<markers from git to find the changed parts in the file, so git must call our script after it has been executed with its own merge.

Does anyone know if there is a hook we could use to do this, or maybe you can tell git to run this script for conflicts in the specified file?

Regards, Michael

+3
source share
1 answer

If the resolution of the merge conflict is always the same, check . This is described in " Rerere Your Boat ... " and in the " gitster magazine - Fun with rerere " git rerere

The name means " reuse recorded permission ", and as the name suggests, it allows you to ask Git how you resolved the conflict with hunk so that the next time he sees the same conflict, Git can automatically resolve it for you .

You need to activate it, though:

git config --global rerere.enabled 1
+2
source

All Articles