diff3 makes git produce conflicted parts from both branches while merging and also the same part from their common ancestor. And rerere is a great feature to record conflicts resolutions to be able to apply them later. Read more here: http://psung.blogspot.com/2011/02/reducing-merge-headaches-git-meets.html.
Add these lines into the [alias] section of your ~/.gitconfig file.
vim setup
I’ve come up with this mapping to jump between git conflict markers:
12
" jump to next conflict marker in gitmap <silent><F8> /^\(<\{7\}\\|>\{7\}\\|=\{7\}\\|\|\{7\}\)\( \\|$\)<cr>
Add it to your ~/.vimrc. You can also try this great plugin to use git right inside your brainvim: vim-fugitive.
How to use that
So when you have a merge conflict, run git edit-unmerged, which will open all your conflicted files in vim with the conflict markers. To jump between them, use <F8> to forward, and N to backward. And a few useful tricks: use d<F8> to delete the lines up to the next conflict marker; use V<F8>d to delete everything to the next marker, including it.
When you’re done, you need to mark the files as resolved. Two ways:
Mark one-by-one, as you’re resolving them with :Gw. You need the vim-fugitive plugin for that.
Resolve and save everything, and quit vim with :wq, :qa. Then run git add-unmerged.
That’s it. Easy! (I tried using vimdiff to resolve conflicts, but it looks much more complicated with multiple windows in most cases).