10

For a given commit, I need to run blame on the previous version of each line changed but said commit.

Having a commit that changes lines 2 and 3 on file a, I want a way to see the output of git blame commit^ limited to the preamble and the lines 2 and 3.

How can I do that?

EDIT

Seems like I have to explicitly specify that I'm looking for a way to do the above programmatically, and not examining the commit with my own eyes, determining which lines of which files where changed, and then manually run git blame for each single changed file.

4

1 回答 1

1

你可以试试:

git blame <commit>^ -- filename | head -3 | tail -2
于 2013-07-03T19:51:44.957 回答