使用VS Code作为版本合并编辑器


VSCode 1.70支持版本合并编辑功能,可以通过设置"git.mergeEditor": true激活。
可以作为它可以作为 git mergetool合并工具。
合并冲突是非常麻烦,这个编辑器给出三个界面(三路合并),左右分别是冲突的两个版本,下面第三个横版面则是你通过选择代码行后合并后的结果。

试用预览版:https ://code.visualstudio.com/insiders/

为了将它用于git,您还需要添加--wait参数,例如

[merge]
    tool = code-insiders
[mergetool]
    writeToTemp = true
    keepBackup = false
[mergetool "code-insiders"]
    cmd = code-insiders --wait -m $REMOTE $LOCAL $BASE $MERGED