How to use Visual Studio Code as the default editor for Git MergeTool

后端 未结 5 2126
失恋的感觉
失恋的感觉 2020-12-12 09:18

Today I was trying to use the git mergetool on the Windows command prompt and realized that it was defaulting to use Vim, which is cool, but I\'d prefe

5条回答
  •  伪装坚强ぢ
    2020-12-12 09:41

    On top of the excellent existing answer, you should open VS Code in a new window by adding -n to the command line.

    So your git config --global --edit looks something like this.

    [merge]
            tool = vscode
    [mergetool "vscode"]
            cmd = code -n --wait $MERGED
    [diff]
            tool = vscode
    [difftool "vscode"]
            cmd = code -n --wait --diff $LOCAL $REMOTE                                                    
    

提交回复
热议问题