VS code has nice inbuilt feature to diff two files.
Is it possible to use vs code diff as the diff tool for git?
Like Maciej says, gitconfig
is the way to go. With this I can set it up to be not just a difftool, but also the merge tool for git.
[diff]
tool = vscode
[merge]
tool = vscode
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[mergetool "vscode"]
cmd = code --wait $MERGED
I use VSCode Insiders, to get the latest (but still stable) features ahead of time
[diff]
tool = vscode
[merge]
tool = vscode
[difftool "vscode"]
cmd = code-insiders --wait --diff $LOCAL $REMOTE
[mergetool "vscode"]
cmd = code-insiders --wait $MERGED
Edit: There is now official VSCode Documentation for this.
In your ~/.gitconfig
file:
[merge]
tool = code
[mergetool "code"]
cmd = code --wait --merge $REMOTE $LOCAL $BASE $MERGED
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With