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.
Written by Adam Stankiewicz
Related protips
2 Responses
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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#