Git blame committed line

git

Solution

You can use `git blame -l filename` to get the SHA1 hash from when the line was changed.

You also can use --reverse:

--reverse

Walk history forward instead of backward. Instead of showing the revision in which a line appeared, this shows the last revision in which a line has existed. This requires a range of revision like START..END where the path to blame exists in START.

See: http://www.kernel.org/pub/software/scm/git/docs/git-blame.html

Problem

Is it possible somehow for GIT to find which commit introduced a specific line of code in a specific file? This is assuming that there have been many commits since that line was added. Or is this something that must be done in a script while looking at the git blame of all the commits for the file in which the line is present? To clarify Original file->Line Added to file and committed -> Many other commits adding other lines and changing the code

Original source