Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TortoiseGit, configure automatic merge tool on per-file-basis

I am using Msysgit with TortoiseGit to manage repositories containing different file types that need special diff and merge tools, including Matlab Simulink files.

I have configured these tools in TortoiseGit -> Settings -> External Programs -> Diff Viewer / Merge Tool. Principially, the configuration works.

Now I have encountered the problem, that TortoiseGit tries to merge my Simulink files automatically, using its own merge tool, which results in the error message:

"Merge conflict in filename.mdl. Automatic merge failed; fix conflicts and then commit the result."

Also, the file TortoiseGit tried to merge is corrupted afterwards. The file is highlighted with an exclamation mark and I can resolve the error with my configured merge tool via the TortoiseGit context menu.

I have worked around the automatic merging problem by specifying

*.mdl -merge

in my gitattributes file. Now TortoiseGit does no longer try to merge automatically, but I still have to invoke the merge tool via the context menu to fix the conflicts for each .mdl file.

Is there a way to force TortoiseGit to invoke the special .mdl-file merge tool as a replacement for its own automatic merge tool? The configuration must be on a per-filetype-basis.

like image 402
user1211741 Avatar asked Nov 14 '22 10:11

user1211741


1 Answers

Go to TortoiseGit settings -> Diff viewer -> Merge. There click on the Advanced button. Here you can configure different merge tools for specific file types.

like image 197
MrTux Avatar answered Nov 15 '22 23:11

MrTux