I've set the external merge tool to be WinMerge, and I've also tried using the Custom option and pointing it to the exe-file, but I'm having trouble launching either, and I can't find any information on what the custom option needs to work.
When trying to launch external merge tool, a window pops up and disappears really quickly, and no application starts.
You can only use WinMerge as an external diff tool, not as an external merge tool (that's why it's not in the list of merge tools).
Ironically despite its name, WinMerge is not a proper merge tool, it only does 2-way comparisons rather than the 3-way merge that Git uses.
Right! Ended up using Beyond Compare. I don't know how I managed to miss the "Merge tool" part and only see the "External diff tool", figures why I couldn't get any merge going. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since 2.16.0 (released 4 days ago), it supports 3-way merges !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jonathan Demeyerdo you have a working config example?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Francois du Plessis I use the "custom" option, give the path to Winmerge and give those arguments :
-e -u -dl \"Mine\" -dm \"Merged\" -dr \"Theirs\" \"$LOCAL\" \"$MERGED\" \"$REMOTE\"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jonathan DemeyerThank you and God bless
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I guess I need to look into 3-way merge more that Steve Streetling mentions but I have setup WinMerge as an external tool. Here are the settings needed. It sets the display so your local file is on the right site.
The setting location: Tools->Options->Diff
External Diff Tool: Custom
Diff Command: C:\Program Files (x86)\WinMerge\WinMergeU.exe
Arguments: $LOCAL $REMOTE
External Merge Tool: Custom
Merge Command: C:\Program Files (x86)\WinMerge\WinMergeU.exe
Arguments: /w1 $LOCAL $REMOTE $MERGED
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Update: WinMerge can now do 3 files. So now you can include the base file.
External Diff Tool: WinMerge
Diff Command: C:\Program Files\WinMerge\WinMergeU.exe
Arguments:
-wl -dl Remote -dr Local \"$REMOTE\" \"$LOCAL\"
External Merge Tool: WinMerge
Merge Command: C:\Program Files\WinMerge\WinMergeU.exe
Arguments:
-wl -wr -dl Remote -dm Base -dr Local \"$REMOTE\" \"$BASE\" \"$LOCAL\" -o \"$MERGED\"
To explain the arguments:
"-wl" makes left file ($Remote) read only so you don't accidentally start editing the wrong file.
"-wr" read only for the right ($Local) file
"-dl Remote" Naming the $Remote file "Remote"
"-dm Base" Naming the $Base file "Base"
"-dr Local" Naming the $Local file "Local"
"-o" sets up $Merged as the output file as your result of the merge.
source: http://manual.winmerge.org/Command_line.html
EDIT:20211028 Fix arguments to maintain conventional naming and make the middle file the merge file for a 3 way merge.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Shawn Murphy Thank you very much for sharing these settings, but I found that there were some parts of your merge arguments that could be improved upon:
Please correct me if I am wrong.
This results in the following arguments for merge:
-wl -wr -dl Remote -dm Base -dr Local \"$LOCAL\" \"$BASE\" \"$REMOTE\" -o \"$MERGED\"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Guillaume Tong . I missed the quotes. Good catch. I'll have to look more into the auto-merge function of WinMerge. I did not know about it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think the Remote and the Local must be switch otherwise it will be show not correct in the header names as the opened file.
I think it must be change to this:
-wl -wr -dl Remote -dm Base -dr Local \"$REMOTE\" \"$BASE\" \"$LOCAL\" -o \"$MERGED\"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@s_kniebuehler No i don't think so. For me the right anwser is the one @Guillaume Tong
Even though that should be the right behavior, it isn't. It appears that winmerge reverses the order of the files in the application panels. Below my command line
-e -u -x -wr -wl -dl \"Local - \"$MERGED\"\" -dm Base -dr \"Remote - \"$LOCAL\"\" \"$REMOTE\" \"$BASE\" \"$LOCAL\" -o \"$MERGED\"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Couru D_avance I have done a test with winmerge 2.16.6.0 where I have written three files: remote.txt, base.txt and local.txt. I have written in the files the name of the file.
Then you can easy see what is happen.
Question to your command line:
Why do you add $MERGED to the title of the left side? This side is read only.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @s_kniebuehler . Just did your test with the command line arguments and merging 3 files with their name in each file. The arguments in the Suggestion above were right on.
-wl -wr -dl Remote -dm Base -dr Local \"$REMOTE\" \"$BASE\" \"$LOCAL\" -o \"$MERGED\"
As for the $Merged on the left, that is requesting WinMerge to pass this file (the final result in the middle pane) back to SourceTree as the result of the merge process. SourceTree then stages that file for commit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.