-
-
Save shawndumas/6158524 to your computer and use it in GitHub Desktop.
[mergetool] | |
prompt = false | |
keepBackup = false | |
keepTemporaries = false | |
[merge] | |
tool = winmerge | |
[mergetool "winmerge"] | |
name = WinMerge | |
trustExitCode = true | |
cmd = "/c/Program\\ Files\\ \\(x86\\)/WinMerge/WinMergeU.exe" -u -e -dl \"Local\" -dr \"Remote\" $LOCAL $REMOTE $MERGED | |
[diff] | |
tool = winmerge | |
[difftool "winmerge"] | |
name = WinMerge | |
trustExitCode = true | |
cmd = "/c/Program\\ Files\\ \\(x86\\)/WinMerge/WinMergeU.exe" -u -e $LOCAL $REMOTE |
Very useful, thank you
you should use
git difftool
NOT git diff
this takes me quite a while
I made this change in the .gitconfig. Now how do I specify the files for comparison once in Git Bash
Awesome
Has anyone had problems with this configuration recently on Windows 10 Visual Studio 2017? I am getting this on the output; "Failed to start the configured compare tool. Using the default compare tool instead."
Nice One!
Thanks
i'm getting the nul path error too
Tbd19 I had the same problem. This is what i did.
git difftool --tool-help
It should tell you what the available diff tools are.
I did:
git config diff.tool winmerge
Very helpfull. Thanks!
Thank you man!! 👏 🎉
Thank you a lot!
Saved me a lot of time, thanks.
Thanks
WinMerge was supposed to be a two-way diff ( pending WinMerge3 ) and not a three-way diff as git require. is that updated to 2.16 ( 3 way ) ?
Great
This worked for me to test for empty file and fix the \nul\ problem
cmd = [[ $LOCAL != "/dev/null" ]] && "c:/Program\\ Files/WinMerge/WinMergeU.exe" -u -e $LOCAL $REMOTE
Thanks to the author, but I suggest this set of options for mergetool/cmd:
-u -e -fm -wl -dl "Local" -wr -dr "Remote" $LOCAL $MERGED $REMOTE
This way MERGED file is in the middle pane, so you can apply changes directly from LOCAL or REMOTE. Additionally, LOCAL and REMOTE are marked "read only"
I tried the diff settings above, but they didn't work for me. It was the path to winmerge that was not right syntactically. After trying a dozen combinations or so, I finally landed on one that worked.
I'm sure there is a version of the Windows long file name form that works, but I have stopped searching now. PROGRA~1 is the short DOS 8.3 folder name for the "Program Files (x86)" folder where my winmerge is located.
[diff]
tool = winmerge
[difftool "winmerge"]
name = WinMerge
trustExitCode = true
cmd = /c/PROGRA~2/WinMerge/WinMergeU.exe -u -e $LOCAL $REMOTE
I also tried just using tool=winmerge
since that is supposed to be built-in, but it didn't work.
Tip: running this command would sometimes help me know if my path was not formatted correctly.
git difftool --tool-help
Me:
Windows 8
git version 2.21.0.windows.1
u r da man !!!! seems like i needed a diff.tool (vs difftool) entry to get this to work, though.
Warning: This is right for diffs, but this will burn you if you use it for merges! I used this and had to redo my merge changes.
Use mrsteklo's version of the options above, or alternatively:
cmd = "/c/Program\\ Files\\ \\(x86\\)/WinMerge/WinMergeU.exe" -u -e -wl -wr $LOCAL $BASE $REMOTE -o $MERGED
VS2019 Enterprise 16.9.4
Winmerge 2.16.8.0 x86
I could only get it to work like this:
[difftool "winmerge"]
name = WinMerge
trustExitCode = true
cmd = \"C:\\Program Files (x86)\\WinMerge\\WinMergeU.exe\" -u -e \"$LOCAL\" \"$REMOTE\"
Thanks a lot CAPeddle !!
It's the only one working with Visual Studio 2019 and my winmerge 2.16.14.0
Additional thing to check: file MySolution.git\config (yes, the file name is "config" without extension):
Verify if you have:
[diff]
tool = winmerge
You can modify it with the following command (Visual studio Menu "Git"\Open in Command Prompt":
git config diff.tool winmerge
Neither cmd = "C:\Program Files (x86)\WinMerge\WinMergeU.exe" nor
cmd = "/c/Program\ Files\ \(x86\)/WinMerge/WinMergeU.exe" worked for me.
It always show Visual Studio Diff tool and open in visual studio itself?
Searched the entire internet, this is the ONLY solution that worked 100%!!!!
Neither cmd = "C:\Program Files (x86)\WinMerge\WinMergeU.exe" nor
cmd = "/c/Program\ Files\ (x86)/WinMerge/WinMergeU.exe" worked for me.
It always show Visual Studio Diff tool and open in visual studio itself?
I didn't try either, but from working with mixed-style path configs a lot in the past I would suggest:
cmd = "C:\Program Files (x86)\WinMerge\WinMergeU.exe" (Windows style)
(double backslashes (i,e, escape the backslashes) since it's in a quoted string),
OR
cmd = "/c/Program Files (x86)/WinMerge/WinMergeU.exe" (POSIX style)
(no escaping special chars (space, parens) since it's in a quoted string).
I deal with this a lot since BASH is the only command shell I use on Windows.
Thanks to the author, but I suggest this set of options for mergetool/cmd: -u -e -fm -wl -dl "Local" -wr -dr "Remote" $LOCAL $MERGED $REMOTE This way MERGED file is in the middle pane, so you can apply changes directly from LOCAL or REMOTE. Additionally, LOCAL and REMOTE are marked "read only"
Hi, mrsteklo, thanks.
I just tried, and I think your method is correct, thanks!
When I see in the middle panel, there are many ">>>>>> or <<<<<<<" like text, is that correct?
Do I need to manually "copy right to middle" or "copy left to middle" to solve such conflict?
Thanks!
Warning: This is right for diffs, but this will burn you if you use it for merges! I used this and had to redo my merge changes.
Use mrsteklo's version of the options above, or alternatively:
cmd = "/c/Program\\ Files\\ \\(x86\\)/WinMerge/WinMergeU.exe" -u -e -wl -wr $LOCAL $BASE $REMOTE -o $MERGED
@christopherliu I think this method is not correct. Especially that you use the $BASE
. This is because in this case, the base code is shown in the middle panel, the base code is normally the common ancestor commit of the both two git branches, and you have to manually add many changes from both the left(local) and right(remote) commits.
I would suggest you could use $MERGED
, this is already generated file by git, and some parts of the changes are already merged without any conflict, it it see a conflict, git will put something like <<<<<<<<<
and >>>>>>>>
in the $MERGED
, so that you can edit the conflict part.
Finally this worked for me
[mergetool "winmerge"]
name = WinMerge
trustExitCode = true
cmd = ""C:/Program Files (x86)/WinMerge/WinMergeU.exe" "$LOCAL" "$REMOTE" "$MERGED" >/dev/null 2>&1"
[diff]
tool = winmerge
[difftool "winmerge"]
name = WinMerge
trustExitCode = true
cmd = ""C:/Program Files (x86)/WinMerge/WinMergeU.exe" "$REMOTE" "$LOCAL" >/dev/null 2>&1"
command to diff
"git difftool"
and from winmerge I manually merge with winmerge functionality
Works for me, too. Thank you very much!