2

Currently, I have VS Code configured to be my git difftool and git mergetool

My ~\.gitconfig file looks like this:

[user]
    email = myemail@gmail.com
[merge]
    tool = vscode
[mergetool "vscode"]
    cmd = code --wait $MERGED
[diff]
    tool = vscode
[difftool "vscode"]
    cmd = code --wait --diff $LOCAL $REMOTE

However, when I run git difftool, it will ask me

Viewing (1/6): 'Repo\directory\someCode.cs'                                                                                                                 
Launch 'vscode' [Y/n]?

Is there a way to open all diffs at once? It is useful to be able to cycle between files without having to close them.

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
Kellen Stuart
  • 7,775
  • 7
  • 59
  • 82
  • 1
    Would git difftool --dir-diff help? As in https://stackoverflow.com/a/17739808/6309. – VonC Jan 25 '20 at 07:16

3 Answers3

1

The easy way I found is:

  1. Adding an alias for the .bashrc file located in /home/.bashrc (Debian/Ubuntu distro).
  2. At the end add the line alias difftool="git difftool -y" and save it.
  3. Reload the bash with the command source ~/.bashrc from the terminal.
  4. Try to run it again.
mustaccio
  • 18,234
  • 16
  • 48
  • 57
1

Check if VSCode 1.53 (Jan. 2021) can help:

Git: New command "Open All Changes":

A new Git command has been added to the Command Palette:

Git: Open All Changes... - Opens all modified and untracked files.

That way, you can directly check changes from VSCode instead of calling VSCode from the command-line though git difftool as I suggested initially in the comment (git difftool --dir-diff).

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Any chance you have an example of how to configure it? I'm not real well versed on manipulating git config files. – Kellen Stuart Feb 01 '21 at 16:50
  • 1
    @KolobCanyon The idea behind that answer is to *not* manipulate git config files, but simply call this new command (in VSCode 1.53 not yet released) – VonC Feb 01 '21 at 17:09
-1
git difftool -d master..prod

This works better