Jim Cheung

Thursday, September 30, 2021

to resolve a complex merge conflict, turn on diff3 it inclues a common ancestor of local and remote file, it might be useful sometimes

git config --global merge.conflictstyle diff3

but for my case a line is missing in the merged result, so I just pull file from both versions and vimdiff them:

$ git show my-branch:./foo.js > foo.js.my-branch
$ git show master:./foo.js > foo.js.master

also I applied these highlight colors:

hi DiffAdd      ctermfg=NONE          ctermbg=Green
hi DiffChange   ctermfg=NONE          ctermbg=NONE
hi DiffDelete   ctermfg=LightBlue     ctermbg=Red
hi DiffText     ctermfg=Yellow        ctermbg=Red
Blog Archive