git blame -L <start,end> <filepath>

Displays the author and revision details for specific lines in a file.

This command is used to uncover who modified certain parts of a file in a git repository by showing the detailed author and revision information for the specified lines in the file.

The -L flag followed by a range <start, end> allows to restrict the output to the given lines range in the file. By default, the line numbers are interpreted as absolute line numbers.

You may as well specify the <start> and <end> parameters according to patterns. Each line numbers or pattern is separated by a comma. Note that end line number is optional. If not provided, this command will consider from start to the end of the file.

Welcome to GitExamples!

Sign in to enable bookmarking, reminders, progress-tracking and more...