When I do a git diff or a git log -p, how do I get line numbers of the source file(s) inlined with the output?
I tried to look it up
You can use git difftool to do the diff with an external editor that will display line numbers. Here's how to do it with vim / vimdiff:
Set vimdiff as git's difftool:
git config --global diff.tool vimdiff
Configure ~/.vimrc to automatically show line numbers when using vimdiff:
if &diff
set number
endif
Run git difftool, which will use vimdiff with line numbers:
git difftool