Unity has a built in tool called UnityYAMLMerge that can be used to automatically merge scene files and prefabs. The tool by itself is limited in that it cannot resolve conflicts when collaborators edit the same game object in a scene though it works fine when adding, deleting, and editing different objects. To resolve the merge conflicts Smart Merge can't handle, the user must install and enable a fallback tool to manually fix the conflict themselves.
- Add the following lines to your local .git/config file.
[merge]
tool = unityyamlmerge
[mergetool "unityyamlmerge"]
trustExitCode = false
keepTemporaries = true
keepBackup = false