Last Updated: March 07, 2017
·
7.345K
· sheerun

Use Fugitive as Git mergetool

Just type following in your terminal:

git config --global mergetool.fugitive.cmd 'vim -f -c "Gdiff" "$MERGED"'
git config --global merge.tool fugitive

From now, you can use git mergetool command to start resolving conflicts in your project in Vim.

You can use GUI by replacing vim with gvim in command above.

2 Responses
Add your response

If you want to force the Gdiff split to vertical you coan use:

git config --global mergetool.fugitive.cmd 'vim -f -c "Gvdiff" "$MERGED"'

over 1 year ago ·

This doesn't seem to quite work if you run with a specific commit, eggit difftool HEAD~1...though you can always quit the left window and do a gdiff - at least it only opens windows that have diffs with HEAD~1.
Perhaps there is a fix for this use-case?

over 1 year ago ·