" vimdiff
if &diff
map <silent> <leader>1 :diffget LOCAL<CR>
map <silent> <leader>2 :diffget BASE<CR>
map <silent> <leader>3 :diffget REMOTE<CR>
map <silent> <leader>u :diffupdate<CR>
map <silent> <leader>s :wqall<CR>
map ] ]c
map [ [c
map <leader>n ]c
map <leader>p [c
map <leader>u :diffupdate<CR>
endif
# Rebase workflow
[mergetool]
prompt = false
[merge]
tool = vimdiff
[alias]
rc = rebase --continue
mt = mergetool
au = add -u
uu = !git --no-pager diff --name-only --diff-filter=U
kn = checkout --theirs # "keep new" --theirs is new work
ko = checkout --ours # "keep old" --ours is base branch (rebase branch)
Start by either:
git rebase master
git merge feature-branch
Iterate through conflicts:
git uu # Show conflicted file
git mt # Runs vimdiff
git kn files # Keep the new version (--theirs)
git ko files # Keep the old version (--ours)
git au # Adds fixed files
git rc # Continues rebase/merge
git rebase --abort # Surrender
Note: "ours/theirs" perspective is of owner of base branch merging in work branch, so --our is old/base, --theirs is new/work