Search code examples
xmlmatchingkdiff3

Merging 3 XML files with kdiff3 (Command Line)


I need 3-way-merge of xml file, for this I am using kdiff3. The problem I am facing with kdiff3 is whenever there is the conflict in merging, kdiff3 is opening the kdiff3-GUI tool and ask to resolve a conflict. Kdiff3 is not saving the file with the conflict. How can I ask kdiff3 to save the file with conflict?

I am using the following command

kdiff3 --auto -m -o merged.xml base.xml  1.xml 2.xml

Solution

  • Same can be achieved by git. Find below the command for this,

    git merge-file -p mine.txt parent.txt yours.txt
    
    -p Send results to standard output instead of overwriting <current-file>.