Git bisect
Is goddamn amazing! I had a very large multi-branch project that somewhere somehow had some crashing bug. Instead of searching through 5 or so branches with 20 something large commits for each, I bisected like 7 times and it told me exactly where to bug was introduced.
Highly recommended
Highly recommended
I agree. Once we get a hang of the value that bisect brings, one unintended consequence is that we start to value atomic commits a whole lot more. There is nothing more annoying than bisecting a bug and suddenly stumbling upon a commit that does it all: updates dependencies, touches everything under the sun, does cleanup commits for unrelated files, etc. Yuck.
I love git bisect
for complex regressions! If I don’t immediately know where a bug is, I write a regression test and then bisect to find where it was introduced. Knowing exactly where the bug was introduced and being able to look at the diff almost always speeds up finding the bug.
git worktree
I was not aware of. Very interesting!
I just took a stab at git worktree
at work this week after rereading this article. It’s amazing. We were in the process of upgrading our UI component library and I was able to checkout pre/post upgrade branches without having to continuously npm install
to swap between dependencies.
Plus I’m pretty sure I could have both “versions” of our repo locally running at the same time so I could do UI comparisons…but I didn’t actually get that far.