Problems / git blame

blame annotates each line of code of a given file with the latest commit and author - this is really helpful for finding the wider impact of a bug, or for finding why the code wasn’t working as expected.

git blame afile

^16797ce (Andy Callaghan 2019-03-26 10:19:22 +0000 1) 1
c890001e (Andy Callaghan 2019-03-26 10:20:59 +0000 2) 2
87b5eff0 (Andy Callaghan 2019-03-26 11:30:24 +0000 3) 4
(END)

Now we’ve found the line and commit we want, let’s inspect what else happened in that commit, by using

git show c890001e

commit c890001ea50335bd5477d73aaf58249c22bacccf
Author: Andy Callaghan <[email protected]>
Date:   Tue Mar 26 10:20:59 2019 +0000

    thirdcommit

diff --git a/afile b/afile
index d00491f..2b2f2e1 100644
--- a/afile
+++ b/afile
@@ -1 +1,2 @@
 1
+3

Let’s move on to finding bugs using bisect binary searching