# GIT - Visual Diff Tool

**URL:** <https://forum.codewithmosh.com/t/git-visual-diff-tool/4308>\
**Category:** Git\
**Created:** [April 21, 2021, 3:01am UTC](https://forum.codewithmosh.com/t/git-visual-diff-tool/4308 "2021-04-21T03:01:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gsanchezolea](https://avatars.discourse-cdn.com/v4/letter/g/b5a626/32.png) [@gsanchezolea](https://forum.codewithmosh.com/u/gsanchezolea)\
**Post date:** [April 21, 2021, 3:01am UTC](https://forum.codewithmosh.com/t/git-visual-diff-tool/4308/1 "2021-04-21T03:01:13Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![JerryC](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/jerryc/32/859_2.png) [@JerryC](https://forum.codewithmosh.com/u/JerryC)\
**Post date:** [May 10, 2021, 11:53pm UTC](https://forum.codewithmosh.com/t/git-visual-diff-tool/4308/2 "2021-05-10T23:53:13Z")

</div>

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”

---

<div class="post-metadata">

**Author:** ![gsanchezolea](https://avatars.discourse-cdn.com/v4/letter/g/b5a626/32.png) [@gsanchezolea](https://forum.codewithmosh.com/u/gsanchezolea)\
**Post date:** [May 11, 2021, 2:03am UTC](https://forum.codewithmosh.com/t/git-visual-diff-tool/4308/3 "2021-05-11T02:03:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JerryC](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/jerryc/32/859_2.png) [@JerryC](https://forum.codewithmosh.com/u/JerryC)\
**Post date:** [May 11, 2021, 1:04pm UTC](https://forum.codewithmosh.com/t/git-visual-diff-tool/4308/4 "2021-05-11T13:04:57Z")

</div>

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](mailto: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.

---

<div class="post-metadata">

**Author:** ![bahamaniacal](https://avatars.discourse-cdn.com/v4/letter/b/73ab20/32.png) [@bahamaniacal](https://forum.codewithmosh.com/u/bahamaniacal)\
**Post date:** [August 23, 2021, 6:18pm UTC](https://forum.codewithmosh.com/t/git-visual-diff-tool/4308/5 "2021-08-23T18:18:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bahamaniacal](https://avatars.discourse-cdn.com/v4/letter/b/73ab20/32.png) [@bahamaniacal](https://forum.codewithmosh.com/u/bahamaniacal)\
**Post date:** [August 23, 2021, 6:34pm UTC](https://forum.codewithmosh.com/t/git-visual-diff-tool/4308/6 "2021-08-23T18:34:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bahamaniacal](https://avatars.discourse-cdn.com/v4/letter/b/73ab20/32.png) [@bahamaniacal](https://forum.codewithmosh.com/u/bahamaniacal)\
**Post date:** [August 23, 2021, 6:49pm UTC](https://forum.codewithmosh.com/t/git-visual-diff-tool/4308/7 "2021-08-23T18:49:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jmrunkle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/jmrunkle/32/3765_2.png) [@jmrunkle](https://forum.codewithmosh.com/u/jmrunkle)\
**Post date:** [August 7, 2022, 3:53am UTC](https://forum.codewithmosh.com/t/git-visual-diff-tool/4308/8 "2022-08-07T03:53:26Z")

</div>

Most likely looking at VSCode’s own documentation would be helpful here: [Version Control in Visual Studio Code](https://code.visualstudio.com/docs/editor/versioncontrol)

---

<div class="post-metadata">

**Author:** ![theorion](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/theorion/32/7783_2.png) [@theorion](https://forum.codewithmosh.com/u/theorion)\
**Post date:** [December 7, 2023, 11:40pm UTC](https://forum.codewithmosh.com/t/git-visual-diff-tool/4308/9 "2023-12-07T23:40:45Z")

</div>

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

> **[How to use VS Code as your Git editor, difftool, and mergetool](https://www.roboleary.net/vscode/2020/09/15/vscode-git.html)**
>
> Do you use VS Code as your default Git editor? Let's look at the potential benefits of using VS Code as a fully-fledged Git partner, and how you can do it.
