git vimdiff mergetool basic commands?
Asked Answered
L

1

6

I have executed git mergetool to try to resolve some merge conflicts.

It opens 3 text windows (within my SSH terminal) with different versions of code in each.

The code I want is in the window on the right.

How do I tell git to take this version and move on?

Here's the screen shot...enter image description here

Lamberto answered 1/12, 2015 at 14:7 Comment(4)
Which merge tool are you using? A screenshot would allow us to tell.Rich
The tool is vimdiff. I added a screenshot.Lamberto
https://mcmap.net/q/13683/-how-do-i-exit-vim#11828573Header
#162313Header
Z
8

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. 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.

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". If you type 2 plus CTRL+G, it shows you the buffer number and file.

Zenithal answered 2/12, 2015 at 2:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.