Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Git Diff and Merge ToolNew to Visual Studio Code? Get it now.
Git Diff and Merge Tool

Git Diff and Merge Tool

David Rickard

|
63,556 installs
| (5) | Free
Launch git difftool and mergetool from VSCode.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Git Diff and Merge Tool

Diff and merge tools can be integrated with Git so they are launched with git difftool <file> and git mergetool <file>.

This extension allows you to launch those tools from Visual Studio Code.

Demo

demo

Setup

To register your diff/merge tool with Git you need to edit your .gitconfig file:

git config --global --edit

For example, this sets up Beyond Compare 4 on Windows:

[diff]
    tool = beyondcompare4
[difftool "beyondcompare4"]
    cmd = \"C:\\Program Files\\Beyond Compare 4\\bcomp.exe\" \"$LOCAL\" \"$REMOTE\"
[merge]
    tool = beyondcompare4
[mergetool]
    keepbackup = false
[mergetool "beyondcompare4"]
    cmd = \"C:\\Program Files\\Beyond Compare 4\\bcomp.exe\" \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"
    trustexitcode = true

keepbackup = false prevents the system from creating .orig backup files after a merge. trustexitcode = true tells Git that the diff tool's exit code can be trusted to determine the outcome of the merge.

Changelog

1.0.5

2021-10-02

  • Added configuration option to disable the notification on launching the tool.
  • Added error notification if VSCode fails to provide the command parameter, which can sometimes happen when the merge conflict list is being refreshed.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft