简体   繁体   English

git vimdiff mergetool基本命令?

[英]git vimdiff mergetool basic commands?

I have executed git mergetool to try to resolve some merge conflicts. 我执行了git mergetool来尝试解决一些合并冲突。

It opens 3 text windows (within my SSH terminal) with different versions of code in each. 它会打开3个文本窗口(在我的SSH终端中),每个文本窗口中都有不同版本的代码。

The code I want is in the window on the right. 我想要的代码在右侧的窗口中。

How do I tell git to take this version and move on? 我如何告诉git继续使用此版本?

Here's the screen shot... 这是屏幕截图... 在此处输入图片说明

According to this blogpost : 根据此博客文章

There are two basic strategies for reconciling a 3-way diff. 调节三向差异有两种基本策略。 You can either keep your cursor in the middle file, and run :diffget with the bufspec for the file containing the change you want to keep. 您可以将光标放在中间文件中,然后使用bufspec对包含要保留的更改的文件运行:diffget。 Or you can position your cursor on the change that you want to keep, and run :diffput with the bufspec for the working copy file. 或者,您可以将光标放在要保留的更改上,然后对工作副本文件使用bufspec运行:diffput。

Now, a bufspec is a buffer number, a pattern for a buffer name or a part of a buffer name, like "v2" in "file.cpp.v2". 现在,bufspec是缓冲区编号,缓冲区名称的模式或缓冲区名称的一部分,例如“ file.cpp.v2”中的“ v2”。 If you type 2 plus CTRL+G, it shows you the buffer number and file. 如果键入2加CTRL + G,它将显示缓冲区编号和文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM