ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
[TOC] > [参考](https://kinboyw.github.io/2018/10/09/Use-Vimdiff-As-Git-Mergetool/) ## 概述 使用vimdiff作为`git mergetool` 效果 ![](https://img.kancloud.cn/b7/69/b769bea02625591ac4be2b4803f6e5bf_967x500.png) 从左至右,从上到下: - LOCAL - 这个文件来自当前分支; - BASE - 两个分支的共同祖先,在两个分支上的文件改变之前的样子; - REMOTE - 要合并到你当前分支的外部分支上的文件;MERGED - 合并结果,将会保存到本地repo中 ## 配置 ``` git config --global merge.tool vimdiff git config --global merge.conflictstyle diff3 git config --global mergetool.prompt false ``` ## 使用 ``` > git merge octodog # merge octodog into master Auto-merging animals.txt CONFLICT (content): Merge conflict in animals.txt Automatic merge failed; fix conflicts and then commit the result. > git mergetool ```