I want to increase the number of lines displayed before and after changes in git diff output.
Analogous to grep -A3 -B5 ...
You can use the -U switch to control the number of lines of context around the diff:
$ git diff -U5
According to git diff --help, git diff supports the same arguments as the standard diff command w/r/t context:
-U<n>, --unified=<n>
Generate diffs with <n> lines of context instead of the usual three. Implies
-p.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With