I know I can use the -n flag in git grep to show the line numbers of the results, i.e
git grep -n "some string"
but how could I include this flag by default without making an alias? I found git config --global grep.lineNumber true but it doesn’t seem to be working for me.
I set my
grep.lineNumberusing your command and it worked for me.Consider using
ack. It’s significantly more programmer-friendly and comes in the repositories of most major Linux distributions.