代码之家  ›  专栏  ›  技术社区  ›  Mark E. Haase

如何在FileMerge中进行三方合并?

  •  5
  • Mark E. Haase  · 技术社区  · 15 年前

    显示

    enter image description here

    底部窗格显示合并的结果。我更想看看原始内容是什么,这样我就可以理解冲突的左右双方的背景。这可能吗?FileMerge有很多帮助文档。

    4 回复  |  直到 12 年前
        1
  •  4
  •   jogojapan    11 年前

    据我所知,这是不可能与filemerge。

    付费(但非常好)应用程序: http://www.deltopia.com/

    开源: http://sourcegear.com/diffmerge/

        2
  •  5
  •   Mark E. Haase    14 年前

    从命令行可以执行以下操作:

    $ opendiff mine theirs --ancestor base
    

    其中“mine”是我的文件版本,“their”是我试图合并的版本,“base”是“mine”和“their”的共同祖先。

    这个命令将打开文件合并,并在底部显示祖先(在我2010年的示例中,合并在这里)。

    不幸的是,不能同时使用--merge选项和--祖先选项。因此,不能同时查看三方合并和使用文件合并来解决冲突。

    我开始使用文件合并来查看和理解冲突,然后像往常一样在文本编辑器中编辑冲突标记(唉……)

        3
  •  3
  •   Jake Griffin    13 年前

    这不完全正确。以下是FileMerge帮助中有关新祖先选项的文档:

    Sometimes, you need to compare two versions of a file that have been modified
    independently. For example, say two people branch a file; that is, they make
    copies of a file and modify it. In this case, specify an ancestor file, which
    is the common ancestor of the modified files.
    
    The ancestor file lets FileMerge choose when to take changes from the left
    file or the right file. For example, say the left file and the right file
    contain a different version of line 33. If line 33 in the ancestor matches
    line 33 in the left file, you know the change happened after the two files
    branched off, and FileMerge prefers the newer version of line 33 in the right
    file. If line 33 is different among the three files, you know that the files’
    editors edited the lines separately. FileMerge displays that difference with
    a red border and asks you to choose with edit to use.
    

        4
  •  2
  •   Brendan White    11 年前

    我意识到这个答案在技术上并不能回答如何做的问题 带文件合并 http://kdiff3.sourceforge.net/ )

    它不是一个漂亮的用户界面,但是(IMHO)它使用起来相当简单,并且工作得很好。而且是开源的。:-)