git can also support full blown Perl regular expressions as well, by compiling git with libpcre. Easy for homebrew users:

Group output like ack!

$ git config --global alias.g "grep --break --heading --line-number"

As far as I know there is no non-trivial way to add default arguments/override git commands, plus g is nice and short.

Compare this output, without grouping:

To this much more readable output, with grouping:

The speed of git grep, which is a product of it being implemented in C and only searching your project files, i.e. not files in .git, is alone compelling — but where git grep becomes unique and powerful is how it connects you with your repo’s git database…