How can I get output like in git diff --color-words
, but outside Git?
Closest thing is wdiff -t
, but it underlines/inverts things instead of using green/red colours and does not allow specifying my whitespace regex.
How can I get output like in git diff --color-words
, but outside Git?
Closest thing is wdiff -t
, but it underlines/inverts things instead of using green/red colours and does not allow specifying my whitespace regex.
Git version 1.9.1:
git diff --word-diff=color fileA fileB
git diff --color-words --no-index
If I'm inside a git repository (git v2.3.3) :
git diff --color-words
doesn't work (no output)git diff --no-index
doesn't accept--color-words
nor--color
argumentsUsing wdiff is possible, configured to use colors, rather than underlined :
Source : https://www.gnu.org/software/wdiff/manual/html_node/wdiff-Examples.html (modified to use foreground colors rather than background colors)
Hope it helps.
you can say
git diff --color=always --color-words
, which will give you the color escape codes in the output. you are going to have some shell to interpret the color codes though …According to a comment from Jefromi you can just use
outside of git repositories too.