Last Updated: February 25, 2016
·
1.883K
· sjwoodr

Lose the Feature Branch

Feature Branches - Don't use them with Git. Here's why:

  1. The whole point of branching is to isolate changes from each other. This appears to be the polar opposite of CI -- which wants to build & test every change as frequent as humanly possible. Developing off on separate branches will break the feedback cycle of testing all the latest changes together to know when something breaks.

  2. Testing with feature branches can get nasty. Even if you're doing continuous testing on your feature branch, and another dev is doing continuous testing on their feature branch, they're not being tested together -- so that's not CI. You could merge multiple feature branches to the mainline at the end of a sprint and chaos ensues. You could see problems that were introduced at any point in the life of those feature branches and it could be very complex to diagnose and fix. This is the problem that CI was designed to eliminate in the first place! :)

Now maybe you would treat the feature branch in such a way that the changes are merged into the mainline branch every day ... in which case, I'd argue that its not really a feature branch anyway, so why call it that?

  1. Some will defend feature branches as better because you can check in even more frequently w/o breaking the build for everyone. But in a distributed system like Git ... that's not really an issue. You're working locally in your copy of the branch and doing builds so you'll know if it builds before you merge to the mainline. This argument falls flat for me. :)