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

  1. Download and install one of the following tools or an equivalent:
    • SourceGear DiffMerge
    • TkDiff
    • Araxis Merge
    • TortoiseMerge
    • WinMerge
    • PlasticSCM Merge
    • Beyond Compare 4
  2. Close Unity if already opened
  3. Open Unity and go to Edit -> Preferences -> External Tools -> Revision Control Diff/Merge
  4. Select installed merge tool image

Merging

  1. git merge <source-branch> <destination-branch>
    Ignore merge conflicts.
  2. git mergetool
    Your external merge tool should automatically open so you can resolve your conflicts.
  3. Commit