3 ms·
The article mentions the git diffing command `git diff --word-diff`, which is cool, but I find an even better version to be: git diff --color-words which s
by ivansavz 1y ago
The article mentions the git diffing command `git diff --word-diff`, which is cool, but I find an even better version to be:
git diff --color-words
which shows words removed in red, and words added in blue. The output produced is similar to `latexdiff` in case you're familiar.
- geocar 1y agoHi buddy you might be colorblind: git diff uses green for added things, not blue. That includes --color-words. You might've also changed your color theme and forgotten. You can pipe through less (or something else that doesn't understand the control code) and look for ^[[31m is red; ^[[32m is green; ^[[34m would be blue (although ^[[36m is kindof a light blue/cyan) to tell if you've reconfigured your terminal, or you've reconfigured git's default colors, but if you haven't done either you might want to get your color-vision checked!
- ivansavz 1y agoOh yes, I found this in my `~/.gitconfig`: [color "diff"] plain = normal meta = bold frag = cyan old = red new = blue I guess I changed to match the red-blue color convention I'm used to from latexdiff.