20 Jan 2016

How to blame in git

Git blame from the command line.

Command format:

git blame -L<LINE_NUMBER>,+<NUMBER_OF_LINES> [<COMMIT>] -- <FILE>

Git blame a file:

git blame -L100,+10 -- file.txt

Git blame on a specific commit:

git blame -L100,+10 fe25b6d^ -- file.txt