diff tool (vscode) doesn't launch from cmd

后端 未结 2 1565
日久生厌
日久生厌 2021-01-06 18:17

Using Git and I want to merge branch lisa into my master branch, like this:

$ git merge lisa

So I opened my repository and then to .git in

相关标签:
2条回答
  • 2021-01-06 18:39

    I actually don't need to set any difftool when working with VSCode.

    Simply do your merge, then open the root folder of your Git repo folder with VSCode.
    If you have installed GitLens, you will see all the changes, including possible conflicts. And you will be able to resolve said conflict directly from VSCode.


    That being said, the config needed seems simpler in "How to use Visual Studio Code as Default Editor for Git MergeTool"

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

    (this assumes here that C:\\Program Files\\Microsoft VS Code is on your %PATH% or $PATH)

    0 讨论(0)
  • 2021-01-06 18:41

    Assuming you have code command in your path, you can also just run the following command in your terminal:

    git difftool -x "code --wait --diff"  
    

    No need to touch the git configurations

    0 讨论(0)
提交回复
热议问题