How to find out who changed the lines of a file?

git blame file_name

To find out who changed each line of a tracked file use git blame file_name. Git blame will show the commit SHA the line was changed in, the author and the date of the change.

Layer 1
Terminal Example
git blame plugins.sbt
c87c79a0b (Tom Ato    2018-08-15 12:14:55 +0200 1) resolvers += Resolver.sonatypeRepo("public")
c87c79a0b (Tom Ato    2018-08-15 12:14:55 +0200 2)
fc7c04df8 (An Chovy   2020-06-26 13:18:19 +0200 3) addSbtPlugin("org.scalaxb"       % "sbt-scalaxb"         % "1.7.3")
bf8a96c16 (Tom Ato    2020-12-30 14:42:39 +0100 4) addSbtPlugin("com.typesafe.sbt"  % "sbt-native-packager" % "1.7.6")
bf8a96c16 (Tom Ato    2020-12-30 14:42:39 +0100 5) addSbtPlugin("org.scalameta"     % "sbt-scalafmt"        % "2.4.2")
fc7c04df8 (An Chovy   2020-06-26 13:18:19 +0200 6) addSbtPlugin("com.eed3si9n"      % "sbt-buildinfo"       % "0.9.0")
5da22cbc4 (An Chovy   2021-07-14 15:01:05 +0200 7) addSbtPlugin("org.scoverage"     % "sbt-scoverage"       % "1.8.2")
bf8a96c16 (Tom Ato    2020-12-30 14:42:39 +0100 8) addSbtPlugin("io.kamon"          % "sbt-kanela-runner"   % "2.0.6")
c87ea0860 (An Chovy   2021-03-03 10:12:40 +0100 9) addSbtPlugin("com.timushev.sbt"  % "sbt-updates"         % "0.3.4")

See git blame to learn more about it.

Last modified on November 30, 2021.

You might also like