30

I have TortoiseSVN set up to use KDiff3 as the conflict resolution tool (I find it shows more information useful to the merge than the built-in TortoiseMerge does).

When I open a file with Tortoise's "Edit Conflicts" command it shows me the three files and I have to select "Merge->Merge Current File" manually. The problem is that KDiff3 saves the result to source_file.working instead of to source_file. So without doing a Save As, the real file with the conflict doesn't get modified. Is there a way around doing this manual Save As every time?

I know this isn't strictly a programming question but it's about an ancillary process common enough to programmers that it should be useful here. I couldn't find the answer to this elsewhere.

bahrep
  • 29,961
  • 12
  • 103
  • 150
Owen
  • 7,494
  • 10
  • 42
  • 52

4 Answers4

44

Mine is a bit longer:

"C:\Program Files\KDiff3\kdiff3.exe" %base %mine %theirs -o %merged --L1 Base --L2 Mine --L3 Theirs
Milen A. Radev
  • 60,241
  • 22
  • 105
  • 110
  • 1
    So it is! And since I'm not entitled to the answer credit for this question, and you were more comprehensive, here you go. – Owen Nov 04 '08 at 00:17
  • 2
    I find that (for me at least) the labels can be set to something which is (occasionally) more helpful thus:- --L1 "Base: %base" --L2 "Mine: %mine" --L3 "Theirs: %theirs" – Ed Randall Feb 07 '14 at 16:28
  • This works. Is there a way to make it so when you close KDiff3 editor that it marks the conflict as resolved? Maybe there is a use-case that makes it beneficial to do something before you manually choose "Mark as resolved", but it would be nice to not have that last step. – Skystrider Aug 26 '15 at 18:34
  • @EdRandall Yours fails when `%mine` or `%theirs` contains whitespace, it tries to open a 3-way merge instead of a diff. Possibly because the content of `%mine` and `%theirs` is wrapped in `"` quotes. – user247702 Oct 14 '16 at 08:35
  • Please give me a command which will work in tortoise git rebase function. I was merged and saved changes in file. But file is still conflict. When I second time open merge, there are any changes which I made. If I click reload, my changes are gone too. – Irq Mishell May 13 '22 at 14:51
6

Turns out I just needed a more specific command line. I had it set simply to the path to kdiff3.exe, and hoped the default arguments passed from TortoiseSVN would be enough. Not so. Here's the one needed (the key being the -o argument):

C:\Program Files\KDiff3\kdiff3.exe %base %theirs %mine -o %merged
Owen
  • 7,494
  • 10
  • 42
  • 52
5

In case there's someone else like me, let me point out his is done in TortoiseSVN->Settings->Diff Viewer. I installed KDiff3 in Windows with Tortoise already installed and it got configured automatically. It took me some time to figure out where this needed to be done.

Carlos
  • 51
  • 1
  • 1
0

I had the same problem, but could solve it without any command line: when I clicked "Edit Conflicts" kdiff3 opend up. After solving the conflict I simply clicked "save" and closed the kdiff3 window. After the window was closed I switched back to the SVN "resolve confict"- window and clicked resolved. Then the next conflict popped up....

lennoxGER
  • 284
  • 1
  • 6