使用vimdiff作为git mergetool
设置 git mergetool 为 vimdiff
git config --global merge.tool vimdiff git config --global merge.conflictstyle diff3 git config --global mergetool.prompt false
用vimdiff解决合并冲突
运行git mergetool
,vim将展示如下
+--------------------------------+ | LOCAL | BASE | REMOTE | +--------------------------------+ | MERGED | +--------------------------------+
移动光标到不同的split
Ctrl w + h # move to the split on the left Ctrl w + j # move to the split below Ctrl w + k # move to the split on top Ctrl w + l # move to the split on the right
移动到MERGED
文件上(Ctrl + w,j),移动光标到一个合并冲突的区域([c
或]c
),然后:
:diffg RE " get from REMOTE :diffg BA " get from BASE :diffg LO " get from LOCAL
最后使用:wqa保存更改并关闭所有的分割
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。