0 votes
1 view
in DevOps and Agile by (20k points)

Is there any way to get git to give you a commit log for just commits that touched a particular line in a file?

Like git blame, but git blame will show you the LAST commit that touched a particular line.

I'd really like to get a similar log of, not the list of commits to anywhere in the file, but just the commits that touched a particular line.

1 Answer

0 votes
by (28.4k points)

This command should work: 

$ git log -u -L <upperLimit>,<lowerLimit>:<path_to_filename>

In this case upperLimit & lowerLimit is the touched line_number

-u is the first line and -L is used to specify the end line of the part for which we intend to see the changes.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...