Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git diff and git difftool do nothing and give no output

I am trying to get git diff to work on Windows 7 64 bit. When I run the following commands from a windows command prompt:

C:\temp\mygrit>git diff

or

C:\temp\mygrit>git difftool

I get no output and no external program launches. Here is my .gitconfig file:

[diff]
    tool = bc3
[difftool]
    prompt = false
[difftool "bc3"]
    cmd = \"c:/program files (x86)/beyond compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\"

I get the same results if I remove all these lines from .gitconfig.

Any idea what's going on?

like image 568
donturner Avatar asked Jun 19 '12 10:06

donturner


People also ask

Why is git diff not showing anything?

Why do you get no git diff output before adding? Git does not treat files in the filesystem as automatically included in the version control system. You have to add things explicitly into the Git repository (as you are doing by adding the current directory with git add . ).

What does diff -- git do?

Diffing is a function that takes two input data sets and outputs the changes between them. git diff is a multi-use Git command that when executed runs a diff function on Git data sources. These data sources can be commits, branches, files and more.

How do I run git Difftool?

Usage. Run Git Difftool: Diff File from the Command Palette or use ⌥⌃D to diff the currently open file. Run Git Difftool: Diff Project from the Command Palette or use ⌃⇧D to diff the whole project.


1 Answers

OK, simple answer. The default behaviour for git diff is to show the all files which have been modified but not staged. If you have no modified files then there is no output.

git difftool uses the output of git diff so if there's no output from the previous command git difftool will do nothing as well.

Solution: Change some files but don't stage them, re run the commands. If there are problems with your config file they will show up then.

like image 103
donturner Avatar answered Oct 15 '22 16:10

donturner