如何在 FileMerge 中进行三向合并?
我看到指定三个文件(左文件、右文件和祖先文件)的选项,但似乎不可能实际显示祖先文件。
底部窗格显示合并的结果。我宁愿看看原始内容是什么,这样我就可以了解冲突左右双方的背景。这可能吗? FileMerge 的帮助文档很糟糕。
I see the option for specifying three files (left, right, and ancestor), but it doesn't seem to be possible to actually display the ancestor.
The bottom pane shows the result of the merge. I'd rather see what the original content was, so I could understand the context for the left and right sides of the conflict. Is this possible? FileMerge has awful help documentation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
看起来在 2.5 版本中他们终于添加了这个功能。 “祖先”现在实际上意味着“祖先”,并且有一个单独的“合并”选项
从命令行您可以执行如下操作:
其中“我的”是我的文件版本,“他们的”是我正在尝试的版本合并,“base”是“我的”和“他们的”的共同祖先。
此命令将打开文件合并并在底部显示祖先(在我的 2010 年示例中,合并是在其中)。
不幸的是,这是不可能的使用 --merge 选项和 --ancestor 选项,因此您无法同时查看三向合并并使用文件合并来解决冲突
。冲突,然后像往常一样在文本编辑器中编辑冲突标记(叹气......)
Looks like in version 2.5 they have finally added this feature. "Ancestor" now actually means "Ancestor" and there is a separate "merge" option
From the command line you can do something like this:
Where "mine" is my version of the file, "theirs" is the version I'm trying to merge with, and "base" is the common ancestor of "mine" and "theirs.
This command will open File Merge and show the ancestor at the bottom (where the merge is in my example from 2010).
Unfortunately, it's not possible to use the --merge option along with the --ancestor option. So you can't view a three-way merge AND use File Merge to resolve the conflicts at the same time.
I am starting to use File Merge for viewing and understanding the conflict, then editing the conflict markers in a text editor as usual. (sigh...)
据我所知,文件合并不可能做到这一点。
付费(但非常好)应用程序:http://www.deltopia.com/
开源:http://sourcegear.com/diffmerge/
To my knowledge, this is not possible with filemerge.
Paid (but very good) app: http://www.deltopia.com/
Open source: http://sourcegear.com/diffmerge/
@梅哈斯:
这并不完全正确。以下是 FileMerge 帮助中有关新祖先选项的文档:
因此,祖先仍然不显示,但它可以帮助合并工具在默认情况下决定选择左侧或右侧时做出更明智的决定。
@mehaase:
That is not exactly correct. Here is the documentation on the new ancestor option from FileMerge Help:
So the ancestor is still not displayed, but it helps the merge tool to make a little more informed decisions when it decides to choose the left or right sides by default.
我意识到这个答案从技术上讲并没有回答如何使用 FileMerge 做到这一点的问题,但我使用 kdiff3 (适用于 Windows、Mac 和 *nix),它显示了基础/祖先,加上左右边,加上输出/结果,用于 3 路合并。 (http://kdiff3.sourceforge.net/)
这不是一个漂亮的用户界面,但是(恕我直言)它是使用起来相当简单并且效果很好。而且它是开源的。 :-)
I realise this answer technically doesn't answer the question on how to do it with FileMerge, but I use kdiff3 (available for Windows, Mac and *nix) and it shows the base/ancestor, plus left and right, plus output/result, for a 3-way merge. (http://kdiff3.sourceforge.net/)
It's not a pretty user interface, but (IMHO) it's fairly simple to use and works well. And it's open source. :-)