![]() ![]() This question looked like it might offer an answer at first, but it deals with differences between two specific files, not between two specific commits. Ignore all whitespace changes with git-diff between commits git -c core.whitespace=-trailing-space,-indent-with-non-tab,-tab-in-indent diff -U0 -word-diff-regex=']' ![]() The -c flag changes git config just for one command. You can also do all the above in one command. You can use -U0 to tell Git to give you 0 lines of context, like so, git diff -w -U0 -word-diff-regex=']'īut you'll still get output that looks pretty much like context, but it's still much better than looking through all the changes carefully and manually to make sure they are only whitespace changes. You'll still see the context, which (in my case, since I'm trying to ensure that there are no differences except whitespace differences) is not helpful. Instead of just using git diff -w, add -word-diff-regex=']': git diff -w -word-diff-regex=']' Next, you must control the definition of a word used. git config core.whitespace '-trailing-space,-indent-with-non-tab,-tab-in-indent' Perhaps there is a better answer, but the best solution I've found so far is this.įirst, you must control the definition of "whitespace" that Git is currently using. For instance, this question is about merging, not displaying differences, and this question deals with displaying word-level differences, and so forth. Everything else turned up by searching was a dead end as well.
0 Comments
Leave a Reply. |