Now start merge tool:
git mergtool
Git will invoke vimdiff with the following window layout. There are four buffers in this layout:
Here is the explanation of each buffer:
Buffer |
Explanation |
Buffer Number |
---|
THEIRS |
contents of the file on the current branch |
2 |
BASE |
common base for the merge |
3 |
YOURS |
contents of the file to be merged. |
4 |
MERGED |
The file containing the conflict markers. You need edit and commit this file. |
1 |
You could use hot key ",2" (comma + two) ",3" (comma+three) ",4" (comma+four) to pick the content you want to use (either THEIRS or BASE or YOURS) to replace the marked conflict in MERGED buffer whose buffer number is one.
Or you can edit the content directly in MERGED buffer. Anyway, git only care about the the file binding to MERGED buffer. Any other buffer will be ignored by git.
You can use hot key "[c" and "]c" to navigate to previous/next conflict (including the conflict resolved by git automatically) in current file which is binding to MERGED buffer.
After finishing editing of the conflicting file in MERGED buffer, you can use hot key ":xa" to exit vimdiff. Git will open next conflicting file with vimdiff automatically.
When you have resolved all the conflicts, follow the hint of git to commit your changes.
转自: http://blog.csdn.net/redguardtoo/article/details/9076961