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

后端 未结 5 2124
失恋的感觉
失恋的感觉 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:44

    I had to replace the double quotes with simple quotes:

      git config --global difftool.vscode.cmd 'code --wait --diff $LOCAL $REMOTE'
    

    for it to work properly (with double quotes, $LOCAL and $REMOTE are replaced by their values).

    This is needed if you are using Git Bash for Windows instead of Windows Command Prompt.

提交回复
热议问题