Tech & AIrelated: r/git

Find a bug with git bisect

Let git binary search your history and point at the exact commit that broke things.

time
one hour
cost
free
effort
some effort
where
at your desk

what it is

  • git bisect checks out the middle commit between a good and a bad version, and you say which it is.
  • Then it halves the range again.
  • Even 1000 commits take only about 10 steps.

how it goes

  1. Pick a repo where something worked before and now does not, or break one of your own projects on purpose.
  2. Run git bisect start, then git bisect bad and git bisect good with an old commit hash.
  3. Test each commit git offers and answer good or bad.
  4. Read the guilty commit, then run git bisect reset.

where to go

why try it

People describe the first bisect as feeling like a magic trick, and it works on any project with history.

More in Tech & AI, or pick a niche.