GIT - Visual Diff Tool

I am on the 13th segment of the 5 hour course currently looking at Visual Diff Tools, I have gone ahead and run the following commands in the following order in regards to setup

git config --global diff.tool vscode
git config --global difftoo.vscode.cmd “code --wait --diff $LOCAL $REMOTE”
git config --global -e
git difftool

after running the difftool I have nothing the cursor clears and nothing happens. Any suggestions as to what this could be?

Typo: you typed difftoo instead of difftool

Change:
git config --global difftoo.vscode.cmd “code --wait --diff $LOCAL $REMOTE”

To:
git config --global difftool.vscode.cmd “code --wait --diff $LOCAL $REMOTE”

yup I just tried that and it still does’nt work, I am using Windows by the way not sure if that matters.

Try looking at the file that the commands are updating.
That is C:\users\{your-user-name}\.gitconfig
Back up .gitconfig to another file, and manually edit it.

Watch the part of the lesson where Mosh shows what is in his .gitconfig

IN MY OPINION
I don’t bother configuring a diff tool.
I open VSCode directly and look at diffs.
My .gitconfig is very minimal.

Here’s my .gitconfig:
[user]
email = xxxxxxx@gmail.com
name = Jerry Cxxxxx
[filter “lfs”]
smudge = git-lfs smudge – %f
process = git-lfs filter-process
required = true
clean = git-lfs clean – %f
[core]
longpaths = true
autocrlf = true

Also, I’m using GitBash for my Git command line.

1 Like

My issue is a little different.
vscode opens just fine. There is a “Splash Page” but not files are shown.
How would one use VSCode to compare two files with one is in the staging area?

Thanks

My apologies. I found it. Not sure why vscode is not defaulting to my project directory… probably a $PATH issue in one of the config files. ‘$LOCAL and $REMOTE’ are listed as in the tutorial. Results are different in practice. Hmmm.

Nope. I can’t figure out how to select the Staging Area File / Index Area File. No compare is happening.

Most likely looking at VSCode’s own documentation would be helpful here: Version Control in Visual Studio Code

just had the same problem on windows, found this site with an implementation that worked. note no parenthesis on this

[core]
editor = code --wait
autocrlf = true
[diff]
tool = vscode
[difftool “vscode”]
cmd = code --wait --diff $LOCAL $REMOTE
[merge]
tool = vscode
[mergetool “vscode”]
cmd = code --wait $MERGED