Setting visual studio as default merge tool

26 Mar 2020

git merge

Setting visual studio as default merge tool

Option 1

Team Explorer - Settings

Option 2

Update user git configuration at %userprofile%\.gitconfig

[diff]
    tool = vsdiffmerge
[difftool]
    prompt = true
[difftool "vsdiffmerge"]
    cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\vsdiffmerge.exe\" \"$LOCAL\" \"$REMOTE\" //t
    keepBackup = false
[merge]
    tool = vsdiffmerge
[mergetool]
    prompt = true
[mergetool "vsdiffmerge"]
    cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\vsdiffmerge.exe\" \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\" //m
    keepBackup = false
    trustExitCode = true

VS code also can be used for that - https://www.meziantou.net/comparing-files-using-visual-studio-code.htm


Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.