I've recently found
You've already answered part of your own question (
--break inserts a blank line between files,
--heading prints the file name separately, and
--line-number gives you line numbers on each line).
The rest is just color options, which are set in
git config via the
color.grep.<slot> entries. See the documentation for full details, but note that based on what you asked for, I think this does the trick:
[alias] g = -c color.grep.linenumber=\"bold yellow\" \ -c color.grep.match=\"reverse bold yellow\" \ grep --break --heading --line-number
(this is expressed as you'd see it in
git config --global --edit since the quoting is messy). Add or subtract
-c options to change whatever colors you like, and/or set them to your preferred defaults by setting
color.grep.<name> = color instead of using the
git g alias.