Skip to content

Instantly share code, notes, and snippets.

@wcomnisky
Created November 29, 2023 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wcomnisky/b6c647cc2161d3566717aca4616fc030 to your computer and use it in GitHub Desktop.
Save wcomnisky/b6c647cc2161d3566717aca4616fc030 to your computer and use it in GitHub Desktop.
Configuring vscode as Git diff tool

If you are using Visual Studio Code Insiders (for early adopters) you may need to have a vscode instance/window already running before running your difftool, otherwise it may crash once you finish reviewing the first file (when you have more than one file to check diffs)

git config --global diff.tool vscode
git config --global difftool.vscode.cmd 'code --wait --diff $LOCAL $REMOTE'
@wcomnisky
Copy link
Author

to undo the changes, either run:

git config --global --unset diff.tool
git config --global --unset difftool.vscode.cmd

or run git config --global -e and delete the respective lines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment