git blame (find changes in log)

By Xah Lee. Date: . Last updated: .

Find When is a File Added

git log --diff-filter=A -- filename

Find When is a Line Added to a File?

git blame filename
Show which commit and author last modified each line of a file.
git log -S searchString filename
search for a change.
git log -G regex filename
search for a change by regex.

See git help blame and git help log.