If you have to have coloring, you have to do something ugly:
$ git diff --color web-app/db/schema.rb |grep '^^[\[32m+
This ^[ is actually a raw escape character ( Ctrl + V ESC in bash, ASCII 27). You can use cat -v to determine the required escape sequences:
$ git diff
Such things will work fine with versions of GNU sed , awk , ... YMMV with versions other than GNU.
An easier way is to rotate the coloring:
$ git diff --no-color file
But you can trade nice results for slightly ugly regular expressions.
mu is too short
source share