The --word-diff=color option highlights changes within lines by coloring the differences. The --word-diff-regex=. makes it so that every single character is treated as a "word" for the purpose of diffing, which means it will highlight every changed character in the diff.
How it works:
Added text is typically shown in green.
Removed text is typically shown in red.
Example:
If you change a line from:
bash
hello world
to:
bash
hello git
The output will highlight:
world in red (removed)
git in green (added)
Customizing Colors
If you want to customize the colors, you can use Git's color.diff configuration. For example: