git grep can show after or before line like as unix/linux grep command.
$ git grep -A 5 [some_keyword]
A is first letter of After
$ git grep -B 5 [some_keyword]
B is first letter of Before
$ git grep -C 5 [some_keyword]
C is the first letter of Center (In git command help, a keyword "Center" does not apears but i do not care)
You can pass only number as option.
$ git grep -5 [some_keyword]
...
-<num>, -C <num>, --context <num>
Show <num> leading and trailing lines, and place a line containing
-- between contiguous groups of matches.
-A <num>, --after-context <num>
Show <num> trailing lines, and place a line containing -- between
contiguous groups of matches.
-B <num>, --before-context <num>
Show <num> leading lines, and place a line containing -- between
contiguous groups of matches.
...
- git version 2.17.1