console UI tool for resolving merge conflicts in git... like vimdiff but 'easier'

2.5k Views Asked by At

i'm looking for a console UI tool for resolving merge conflicts in git... like vimdiff but 'easier'

3

There are 3 best solutions below

1
On

This isn't exactly what you're looking for, but git stash is very helpful for resolving merges. Just do:

git stash create
git pull
git stash pop <stashnum>

Where <stashnum> is the output from git stash create

0
On

I stayed with vimdiff, but I usually keep only the file to open visible (run :only when on this window), and then I disable the diff colors (which most of the time hurt the eyes) with :diffoff.

Finally, I have the following mapping which helps me to browse through the conflict markers:

nnoremap <space>n /^\(<<<<\\|====\\|>>>>\)<CR>

In normal mode, press <space>n and it will search for the markers, then use n to go from marker to marker.

From this point, I then edit my conflicts until I am happy.

0
On

The threesome.vim vim plugin provides a friendlier merge tool than vanilla vimdiff.

Regarding the comment about seeing which files are going to change when you git pull: git diff --stat HEAD..origin/$(git rev-parse --abbrev-ref HEAD) after a git fetch will tell you that. (Substitute --name-only for --stat if you really just want the names and nothing else. Or omit --stat altogether to see the actual incoming diffs) You'll likely want to add an alias for this in your global configuration file.