Last Updated: February 25, 2016
·
2.079K
· akalyaev

Don't git blame me

Use 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.

-L option

  • git blame -L <start>,<end> limit the output to lines <start> through <end>.

-M option

  • git blame -M detect moved or copied lines within a file. Important: git annotates the original commit, not the move commit.

-C (CC|CCC) options

  • git blame -C in addition to -M, detect lines moved or copied from other files that were modified in the same commit.
  • git blame -CC look at the commit the file was created in.
  • git blame -CCC looks at all your commits.

Example

Source: http://bit.ly/Soe0xT
Picture

References