Niko Heikkilä

November 7, 2022

Git Flow Is A Bad Idea

Imagine a hypothetical scenario where a customer walks into a store, and the following discussion takes place.

Customer: "Hi! I'd like to buy the <product>."

Clerk: "Mmm, sure thing, but you have to give me two weeks and we'll ship it to you when our next delivery is due."

Customer: "But there's at least ten same products on that shelf? Can't you sell one for me now."

Clerk: "Yes, but… it's our process, you know. All advertised products have to be promoted into our warehouse first, officially stamped, checked by a certified QA specialist, and finally placed into the shipping queue for our shipping department to handle. Don't you worry, I'll get in touch with you before the end of next month if all goes fine."

Customer: walks away baffled with empty hands contemplating a visit to another store

You wouldn't let such a thing happen in your store and certainly not in your software project? Yet piling and managing a large inventory is very common, and engineers are experts at building processes they think protect them from harm.

One example of such a notorious process is Git Flow, and how it provides a false sense of security by placing gates and requiring promotions to the source code before the product increment is verified safe for shipping.

I'm confident Git Flow sticks the best in organisations where some unfortunate incident has happened. As a remedy, the management has ordered more gatekeeping and verification for each iteration. Then engineers seeking to obey have stumbled upon this "best practice" from decade ago. Furthermore, Git Flow is then sold also to organisations that wouldn't need it in the first place because of the power of cargo cults.

As folks at Atlassian put it:

"Gitflow is a legacy Git workflow that was originally a disruptive and novel strategy for managing Git branches. Gitflow has fallen in popularity in favor of trunk-based workflows, which are now considered best practices for modern continuous software development and DevOps practices. Gitflow also can be challenging to use with CI/CD."

Do your product and organisation a favour. Drop using Git Flow, drop excess branching, drop quality gates and start building quality in.

But don't trust my words. Learn more about Git Flow in Dave Farley's excellent video below.

About Niko Heikkilä

Hey there! I'm a Software Craftsman and Extreme Programmer. Currently, I'm shipping quality code at Futurice. I build proprietary software for a living and loving it as much as free and open-source software. Follow this blog for insights on tech, culture, politics and all the small things.

For shorter ruminations, follow me on Mastodon and Bluesky.