There's more...

The blame command can be used even if the file has been refactored and the code has been moved around. With the -M option, the blame command can detect lines that have been moved within the file, and with the -C option, Git can detect lines that were moved or copied from other files in the same commit. If the -C option is used three times -CCC, the blame command will find lines that were copied from other files in any commit.

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.