Problem
I am using GitLab to version control a Unity project. I am trying to set up git so that it will use different tools to merge based on the file extension. I would like git to use WinMerge as it's merge tool for all files except for files I want to use SmartMerge. I do not want git to attempt to automatically merge files I want to use SmartMerge for. Not sure if this is even possible.
Solution Attempt
I've added the following to my config file in my local .git folder to setup git merge:
[merge]
tool = unityyamlmerge
[mergetool "unityyamlmerge"]
trustExitCode = false
cmd = '<path to UnityYAMLMerge>' merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
trustExitCode = true
cmd = '<path to WinMerge>' -u -e -dl "Local" -dr "Remote" $LOCAL $REMOTE $MERGED
And I've added the following to my .attributes file in the top level of my repo to specify what file types to use SmartMerge for:
# Unity YAML
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
*.physicMaterial2D merge=unityyamlmerge eol=lf
*.physicMaterial merge=unityyamlmerge eol=lf
*.asset merge=unityyamlmerge eol=lf
*.meta merge=unityyamlmerge eol=lf
*.controller merge=unityyamlmerge eol=lf
I think part of my confusion lies in how the [section "subsection"] of the config file are used by git. Any guidance greatly appreciated. Thanks in advance!