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?
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 . ).
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With