Caution
Edit the paths to point towards your own installations.
Caution
Some paths use backslashes and others use forward slashes. Take notice of how I have given them below.
- Add this to your
.gitconfig
, it is under%homepath%
:
[mergetool "unityyamlmerge"]
cmd = "'C:/Program Files/Unity/Hub/Editor/6000.0.28f1/Editor/Data/Tools/UnityYAMLMerge.exe'" merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
[mergetool "kdiff3"]
cmd = "'C:/Program Files/KDiff3/kdiff3.exe'" --auto "$REMOTE" -b "$BASE" "$LOCAL" -o "$MERGED"
[difftool "kdiff3"]
cmd = "'C:/Program Files/KDiff3/kdiff3.exe'" --auto "$REMOTE" "$LOCAL"
[mergetool]
prompt = false
trustExitCode = false
keepBackup = false
keepTemporaries = false
[difftool]
prompt = false
trustExitCode = false
keepBackup = false
keepTemporaries = false
[merge]
tool = unityyamlmerge
[diff]
tool = kdiff3
-
Get an appropriate
.gitattributes
file to instruct git which files should use theunityyamlmerge
merge tool. I recommend this. -
Add this to
mergespecfile.txt
, it is in the same folder as theUnityYAMLMerge.exe
:
# KDiff3
* use "C:/Program Files/KDiff3/kdiff3.exe" --auto "%r" -b "%b" "%l" -o "%d"
- If you are using Fork, open
settings.json
, it is in the Fork installation folder. Find theMergeTool
andExternalDiffTool
keys and make them look like this:
"MergeTool": {
"Type": "UnityYAMLMerge",
"ApplicationPath": "C:\\Program Files\\Unity\\Hub\\Editor\\6000.0.28f1\\Editor\\Data\\Tools\\UnityYAMLMerge.exe"
},
"ExternalDiffTool": {
"Type": "KDiff3",
"ApplicationPath": "C:\\Program Files\\KDiff3\\kdiff3.exe"
},