How to merge Unity branches

Setup

  1. Install Sourcetree

  2. Click on Data > Clone / New

  3. Clone your project

  4. Add your Github account

  5. Click on Tools > Options > Diff

  6. Change Merge-Toolto Custom

  7. Add C:\unity\2021.3.1f1\Editor\Data\Tools\UnityYAMLMerge.exe (you may search this .exe on your PC) to Merge-Command

  8. Add merge -p $BASE $REMOTE $LOCAL $MERGED to Arguments

  9. Download TortoiseGit

  10. Add path of TortoiseGit to C:\unity\2021.3.1f1\Editor\Data\Tools\mergespecfile.txt like this * use "%programs%\TortoiseGit\bin\TortoiseGitMerge.exe" -base:"%b" -mine:"%l" -theirs:"%r" -merged:"%d" (at line 21)

Merge branch X to Y

  1. Check out Y

  2. Right click X in History-view

  3. Select Merge...

  4. Switch to Data Status-view

  5. Right click the merge conflicts

  6. Select Resolve conflicts > Start external merge-tool...

  7. Wait (something will happen… eventually… someday…)

  8. When a TortoiseGit-windows pops up fix the conflict manually and press Resolve conflict

  9. Ignore the error and close it and TortoiseGit

  10. Wait

  11. Press Commit in the bottom left corner

  12. Press Push