Git Git Diff Viewing a word-diff for long lines


git diff [HEAD|--staged...] --word-diff

Rather than displaying lines changed, this will display differences within lines. For example, rather than:

-Hello world
+Hello world!

Where the whole line is marked as changed, word-diff alters the output to:

Hello [-world-]{+world!+}

You can omit the markers [-, -], {+, +} by specifying --word-diff=color or --color-words. This will only use color coding to mark the difference:

Example of using git diff --color-words