Bitpath

Boss lesson · Unit 03

Find the commit that broke it

Binary search over history with git bisect

13 exercisesabout 3 min

What you practise

  • git bisect is binary search over history: good, bad, halve
  • How many steps for n commits
  • Automating with git bisect run
  • git blame and git log -S

Try a question from this lesson

Pick one

A test passed 1,000 commits ago and fails now. Checking one commit takes a minute. About how many checks does a smart search need to find the commit that broke it?

The idea

Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.

Concept

Binary search over history

git bisect is binary search on commits. You name one commit where things worked (good) and one where they are broken (bad). Git checks out a commit halfway between and you tell it: good or bad?

Each answer halves the suspects, until one commit is left: the first bad one.

c1  c2  c3  c4  c5  c6  c7  c8  c9
good            ^^              bad
           tested first

11 more exercises in the app

  • 4× multiple choice
  • 2× fill the blanks
  • 2× type the answer
  • 1× true or false
  • 1× order the lines
  • 1× match the pairs

Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.

One email when Bitpath is ready to try. Nothing else. Privacy