Git Blaming Only show certain lines

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Output can be restricted by specifying line ranges as

git blame -L <start>,<end>

Where <start> and <end> can be:

  • line number

    git blame -L 10,30

  • /regex/

    git blame -L /void main/, git blame -L 46,/void foo/

  • +offset, -offset (only for <end>)

    git blame -L 108,+30, git blame -L 215,-15

Multiple line ranges can be specified, and overlapping ranges are allowed.

git blame -L 10,30 -L 12,80 -L 120,+10 -L ^/void main/,+40



Got any Git Question?