加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

vimdiff

发布时间:2020-12-15 22:25:40 所属栏目:安全 来源:网络整理
导读:使用vimdiff作为git mergetool 设置 git mergetool 为 vimdiff git config --global merge.tool vimdiffgit config --global merge.conflictstyle diff3git config --global mergetool.prompt false 用vimdiff解决合并冲突 运行 git mergetool ,vim将展示如

使用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保存更改并关闭所有的分割

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读