Git bisect saved me from a week of debugging. Should've used it sooner.
Git bisect saved me from a week of debugging. Should've used it sooner. Two weeks ago, my coworker merged a feature branch on Friday afternoon. By Monday morning, half our test suite was red. Nobod...

Source: DEV Community
Git bisect saved me from a week of debugging. Should've used it sooner. Two weeks ago, my coworker merged a feature branch on Friday afternoon. By Monday morning, half our test suite was red. Nobody knew which commit broke things. The branch had 47 commits. I did what most devs do. Opened git log, stared at it, closed it. Forty-seven commits. No way I was reading all of them. So I did what any reasonable person would do. Blamed everyone in the commit history until I found someone to be mad at. Just kidding. Mostly. The manual approach Git blame told me which lines changed but not why they broke. Git log showed me filenames but not the actual damage. I spent two days narrowing it down manually. Checked out commit one by one. Ran tests. Watched them fail. Checked out another. Ran tests. Watched them fail. My approach was scientific. My time investment was not. # What I was doing (spoiler: wrong) git checkout commit-xyz npm test # 47 times Forty-seven times. At 3 minutes per run, that's o