如何使用 git mergetool 的 filemerge
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13183730/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to use git mergetool's filemerge
提问by xxjjnn
The documentation is here: http://www.kernel.org/pub/software/scm/git/docs/git-mergetool.htmlA handy guide is here: http://ryanflorence.com/git-for-beginners/
文档在这里:http: //www.kernel.org/pub/software/scm/git/docs/git-mergetool.html一个方便的指南在这里:http: //ryanflorence.com/git-for-beginners/
However, neither of them explain how to use mergetool's filemerge.
但是,他们都没有解释如何使用mergetool 的filemerge。
The guide I read says "I hit enter and FileMerge pops up and I deal with the conflicts:" but it doesn't mention howto "deal with the conflicts".
我读过的指南说“我按回车键并弹出 FileMerge 并处理冲突:”但它没有提到如何“处理冲突”。
When I run:
当我运行时:
git mergetool
:and then hit return as prompted, and the filemerge window opens showing all the merge conflicts, it only responds to the commands cmd+D and cmd+shift+D (which allow cycling through the conflicts). However, there doesn't seem to be a mention of how to, for each conflict, choose left/right/neither. The combo-box dropdown does not seem to do anything.
: 然后按提示回车,文件合并窗口打开,显示所有合并冲突,它只响应命令 cmd+D 和 cmd+shift+D (允许循环遍历冲突)。但是,似乎没有提到如何为每个冲突选择左/右/都不选择。组合框下拉菜单似乎没有做任何事情。
Have already looked at docs, guide, file system menu, and systematically pressed keys on the keyboard looking for a response =)
已经看过文档、指南、文件系统菜单,并系统地按下键盘上的键寻找响应 =)
回答by ArtOfWarfare
I haven't found any official documentation for it, but here's the understanding I got from trial and error:
我还没有找到任何官方文档,但这是我从反复试验中得到的理解:
There's a split view with your two options on the left and right. You can't edit either of those. There's also a bottom view which you can edit. You might need to pull up on the little circle in the middle of the bottom of the screen to expand that section.
有一个拆分视图,左侧和右侧有两个选项。您不能编辑其中任何一个。还有一个底部视图,您可以对其进行编辑。您可能需要拉起屏幕底部中间的小圆圈以展开该部分。
For each conflict, click on the area in middle of the left/right split view and choose from the drop down in the lower right either "Choose Left" if the left is what you want or "Choose Right" if that is what you want. If neither option is good, click "Choose Neither" and edit it in the bottom section.
对于每个冲突,单击左/右拆分视图中间的区域,然后从右下角的下拉列表中选择“选择左侧”(如果左侧是您想要的)或“选择右侧”(如果这是您想要的) . 如果这两个选项都不好,请单击“都不选”并在底部进行编辑。
There's an arrow in the middle column that will show whether you've chosen left or right by pointing at it. If you've chosen neither, the arrow will disappear. All three views scroll together using the scroll bar on the far right screen.
中间列中有一个箭头,通过指向它会显示您是选择向左还是向右。如果您都没有选择,箭头将消失。所有三个视图都使用最右侧屏幕上的滚动条一起滚动。
When you're done, click File > Save Merge from the menubar.
完成后,单击菜单栏中的文件 > 保存合并。