git blame

The command git blame shows the last commit that touched each line of a file. This can be really handy if you’re trying to figure out whether a bit of code is new or has been around for a long time.

git blame my-interesting-file.go
Hint for using git blame
In order to get the most out of git blame and commands like it, you want to be sure you’re committing succinctly. In other words, ensuring that each commit covers only ony atomic change, and that the commits have meaningful commit messages.