Matt Stenson

This is the personal site of Matt Stenson. I'm a programmer, nerd, mountain biker, dirt biker and outdoors enthusiest. I'll blog about different stuff here. I like open software and privacy focused tools.

Git changelog for particular line numbers

Reading Time: 1 min

I often need to go spelunking through code that predates my work on the codebase. Sometime looking through the commit history for a large file can be rather overwhelming if there are lots of commits not related to the particular section of the file you are interested in.

I recently discovered that git log has an option -L to specify line numbers. This allowed me to look at just the area of the file I needed to in the log:

git log  -L 490,493:example.php

See Also