Rider, with Unity integration, automatically runs UnityYAMLMerge on all YAML files when resolving merge conflicts. This may be preferrable to using a standalone solution that has no awareness of the larger project. If you're looking for a more generic solution that works for many diff tools check out mbaker3/UnityYAMLMerge.
Add the following to the .git/config
of your repo. This will configure Rider to launch when you execute git mergetool
or for any git clients that respect the config file.
[merge]
tool = unityyamlmerge
[mergetool "unityyamlmerge"]
trustExitCode = false
cmd = /Applications/Rider.app/Contents/MacOS/rider merge "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
- Open the menu item
Fork -> Settings...
- Select the
Integration
tab. - For the
Merge Tool
drop down selectCustom
. - Press the
Edit
button next to the drop down. - In the
Edit Merge Tool
dialog enter the followingFile Path
-/Applications/Rider.app/Contents/MacOS/rider
Arguments
-merge $LOCAL $REMOTE $BASE $MERGED
- Click
Edit
to save your changes
When there is a merge conflict, select Merge in External Tool
to open the diff in Rider and have it automatically run UnityYAMLMerge on the conflicts. If there are remaining conflicts they can be resolved manually in Rider's diff UI.