git log -L 40,60:src/main.rs

Category: Git - Core

git log -L 40,60:src/main.rs

Show the evolution of a line range

Traces every change to lines 40 through 60 of the named file, printing each commit that touched them with its patch. The range follows the lines as they move within the file. It is line-level archaeology, far more precise than file-level git log.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.