For completeness I use the following git config for mergetool. It uses the vim-fugitive plugin:
[merge]
conflictstyle = merge
tool = fugitive
[mergetool "fugitive"]
cmd = vim "+Gdiff" $MERGED
I also dabbled with my own version that handled the three way merge with mutliple tabs for different perspectives. However, I found that the above fugitive version suited my day to day needs better.
[merge]
conflictstyle = diff3
tool = diffconflicts
[mergetool "diffconflicts"]
cmd = diffconflicts vim $BASE $LOCAL $REMOTE $MERGED
trustExitCode = false
keepBackup = false
From my diffconflict script:
#!/bin/bash
# Use *real* vimdiff to edit merge conflicts in Git
#
# Instead of editing a file with <<<< ==== >>> conflict markers, this opens
# each "side" of the conflict markers in a two-way vimdiff window.
#
# (I'm not clear why this isn't the default behavior for Git's vimdiff
# mergetool script. What purpose does the 'result' window with the conflict
# markers serve that vimdiff can't do better on its own?)
#
# Layout:
#
# Tab1 is a two-way diff of the conflicts.
# +--------------------------------+
# | LCONFL | RCONFL |
# +--------------------------------+
# Tab2 is a three-way diff of the original files and the merge base.
# +--------------------------------+
# | LOCAL | BASE | REMOTE |
# +--------------------------------+
# Tab3 is the MERGED or 'result' file that contains the conflict markers.
# +---------------------------------------+
# | <<<<<<< HEAD |
# | LCONFL |
# | ||||||| merged common ancestors |
# | BASE |
# | ======= |
# | RCONFL |
# | >>>>>>> someref |
# +---------------------------------------+
#
# Workflow:
#
# 1. Save your changes to the LCONFL temporary file (the left window on the
# first tab; also the only file that isn't read-only).
# 2. The LOCAL, BASE, and REMOTE versions of the file are available in the
# second tabpage if you want to look at them.
# 3. When vimdiff exits cleanly, the file containing the conflict markers
# will be updated with the contents of your LCONFL file edits.
# 4. Sometimes it helps to edit the MERGED file manually. Making changes in
# Tab3 will overwrite / destroy changes in Tab1. In other words only
# edit one or the other.
#
# NOTE: Use :cq to abort the merge and exit Vim with an error code.
The full script is on github.