git diff -w to ignore differences in spaces.
You cannot ignore multi-line comments, because git is a version control tool, not a language-dependent interpreter. He does not know what your C ++ code is. It does not analyze files for semantics, so it cannot interpret what a comment is and what is not. In particular, it relies on diff (or configured diffftool) to compare text files and expects a linear comparison.
I agree with @ andrew-c that what you are really asking for is to compare the two parts of the code without comment. More specifically useful, you are asking to compare lines of code where all multi-line comments have been turned into empty lines. You keep blank lines there so that you have the correct line numbers to link to a regular copy.
That way, you can manually convert the two states of the code to empty multi-line comments ... or you can see how to create your own diff wrapper that did the cleanup for you. But the latter is hardly worth the effort.
source share