type__error’s avatartype__error’s Twitter Archive—№ 11,848

  1. Save hours of debugging: find which commit broke something using git bisect. Say I know that 15 commits ago, it was fine: $ git bisect start $ git bisect good HEAD~15 $ git bisect bad HEAD git will take you through specific revisions to find the commit that introduced the bug!
    1. …in reply to @type__error
      you don't have to cycle through all 15 revisions, either - it partitions them cleverly. you just test it each time, respond with "git bisect good" or "git bisect bad", and in a short time you'll get to the offending commit!