Last active
March 29, 2024 00:03
-
-
Save JunielKatarn/530005dd432e2bd4552c856d4f886cc7 to your computer and use it in GitHub Desktop.
Git config to use vsdiffmerge.exe as a diff/merge tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PLEASE SEE FEEDBACK. This script is not up to date and may not use the best practices. | |
[diff] | |
tool = vsdiffmerge | |
[difftool] | |
prompt = false | |
[difftool "vsdiffmerge"] | |
cmd = '"C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/vsdiffmerge.exe"' "$LOCAL" "$REMOTE" //t | |
keepbackup = false | |
trustexitcode = true | |
[merge] | |
tool = vsdiffmerge | |
[mergetool] | |
prompt = false | |
[mergetool "vsdiffmerge"] | |
cmd = '"C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/vsdiffmerge.exe"' "$REMOTE" "$LOCAL" "$BASE" "$MERGED" //m | |
keepbackup = false | |
trustexitcode = true |
Note that git gui
internally implements its own command line formatting for each supported diff tool (see mergetool.tcl), so this doesn't work for invocation by right-clicking in the diff view of git gui
.
Note that
git gui
internally implements its own command line formatting for each supported diff tool (see mergetool.tcl), so this doesn't work for invocation by right-clicking in the diff view ofgit gui
.
Thanks for the tip.
I have not used this config in a long time, but may update so it's correct.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As a warning, setting
diff.tool
causes issues in Visual Studio 2017 Update 9.7 and Visual Studio 2019 Preview 4/RC (like merges outputting a blank file rather than the merged content). It is much safer not to modify diff.tool and instead invoke this viagit difftool --tool vsdiffmerge
.