Git diff with combined --word-diff

Given that the one-word file has changed, the β€œnormal” git diff looks like this:

normal git diff

While git diff --word-diff=color looks like this:

git diff with --word-diff

Is it possible to combine these two to highlight separate lines with highlighted words? Something like that:

combined git diff

It may be trivial, but I could not understand.

+7
git git-diff
source share
1 answer

The links in the comments show how to use extensions and third-party developers.

There is an easy way to add colors to the git configuration file. eg

 [color "diff"] meta = yellow bold frag = magenta bold old = red new = magenta green 

Of course, you can set any supported color to suit your needs.

enter image description here

0
source share

All Articles