git blame when you want to know who last changed the particular line of code and when.
> git blame
I'd recommend to use it with
-w option, which allows you to ignore whitespaces and to see when does actually meaningful change was introduced.
git blame -L <start>,<end>limit the output to lines
git blame -Mdetect moved or copied lines within a file. Important: git annotates the original commit, not the move commit.
-C (CC|CCC) options
git blame -Cin addition to
-M, detect lines moved or copied from other files that were modified in the same commit.
git blame -CClook at the commit the file was created in.
git blame -CCClooks at all your commits.