First, make sure that you are using a color output (e.g. with git diff --color ) and that you have activated the highlighting with (e.g..)
git config color.diff.whitespace "red reverse"
This may not work in all cases, however, since git does not highlight extra spaces for deleted lines. To view the spaces you have removed, simply use
git diff -R
to put a space on the "added" side of the comparison, where it becomes highlighted.
See the answers to this SO question for more details.
Paul Whittaker Jul 16 2018-12-17T00: 00Z
source share