git blame

Show commit hash and last author on each line of a file. More information: https://git-scm.com/docs/git-blame.

git blame path/to/file

git blame -e path/to/file

git blame commit path/to/file

git blame commit~ path/to/file