Using Git with Unity - Alteredux/XR GitHub Wiki
Configuration
Because Unity uses YAML files for scenes and prefabs, Git rarely merges these files without breaking something. This is why Unity created a merge tool to complement Git.
Configure Unity Merge Tool
Follow instructions under the Git section here: https://docs.unity3d.com/Manual/SmartMerge.html
Install External Merge Tool
- Download and install one of the following tools or an equivalent:
- SourceGear DiffMerge
- TkDiff
- Araxis Merge
- TortoiseMerge
- WinMerge
- PlasticSCM Merge
- Beyond Compare 4
- Close Unity if already opened
- Open Unity and go to Edit -> Preferences -> External Tools -> Revision Control Diff/Merge
- Select installed merge tool
Merging
git merge <source-branch> <destination-branch>
Ignore merge conflicts.git mergetool
Your external merge tool should automatically open so you can resolve your conflicts.- Commit