s g s g - 1 year ago 75
Git Question

Filenames not showing in git diff

Using 'Bash on Ubuntu on Windows' on Windows 10 (Insider Preview), git version 1.9.1

I've used

git diff
a million times on other machines, but on this particular setup it's not showing filenames. Here's a screenshot:

enter image description here

The blank white space at the top is missing the usual ---a/file +++b/file among other things. I ran
git config --list
to see if there might be some configuration issues but there are only a few entries in there that aren't related to branches and source locations:

enter image description here

I'm getting these results from both Bash and from cmd. Why might this be happening?

s g s g
Answer Source

As others pointed out, there actually were characters being displayed, it was just a color issue - The background and the font color were both white.

It is possible to configure the font colors for most git output and, in the git diff case, you can actually change the color of different sections of the output. To change the color of the top section (the 'meta' section) of the output, use the following command:

git config --global color.diff.meta "blue"

You can omit the --global if you only want the changes to affect the current session and user, and you can use different colors.

This is a sample output with the color set to 'magenta': enter image description here

More details can be found here: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration