I like the output formatting of git diff. The color and the +/- representation of changes between lines is easier to read than GNU diff.
I can run git diff using --no-index flag outside of a git repo and it works fine. However, it appears to be missing the --exclude option for excluding files or subdirectories from a recursive diff.
Is there a way to get the best of both worlds? (color options and +/- format of git diff and --exclude option of GNU diff).
I’ve experimented with colordiff, but I still prefer the output format of git diff
This will do the
+/-rather than<and>.Since GNU diffutils 3.4 the flag
--colorhas been added. Combining both makes the following:The flag
--coloralso takes an argument, valid options arenever,always, orauto. Useful when you want to be more explicit on what needs to be done.