I came across this rather strongly opinionated blog post –Â GitFlow considered harmful, and I have to say that I mostly agree with it.
In our company, we use a similar approach to the Anti-gitflow, but with even more simplicity. Â This is one particular thing I like so much about git is that each person, team, or company can pick the workflow that suits them best.
Just to give you a little bit of context, we have a rather small development team (under 10 people), but we do a large number of projects. Â All our projects are web-based, varying from small and simple websites (static HTML), through more complex WordPress sites (multilingual, e-commerce, etc), to business applications like CRMs. Â Each project is done by several developers at a time and can later on be passed on to other developers, often much later (another iteration after several month). Â Each developer is working on a number of projects at a time. Â And we do very fast-paced development, often deploying multiple versions per day. Â Given the nature of the projects and the development pace, we don’t ever really rollback. Â Rollback is just another step (version) forward. Â And we don’t have long and complex roadmaps in terms of which features will be released in which version. Â It’s more of a constant review of what’s pending, what needs which resources, and what we can do right now. Â (It’s far from ideal project management, but it somehow works for us. Â If you think you can do better, send me your CV or LinkedIn profile, and we’ll talk.)
In our case, we do the following:
- We have one eternal branch, and we call it master.
- The master branch is always stable and deployable. Â Even though we don’t really deploy it directly.
- Nobody is allowed to commit directly to the master branch. Â Initially it was just an agreed convention, but because people make mistakes, we now have this rule enforced with the technology. Â Both BitBucket and GitHub support protected branches. Â BitBucket, in my opinion, does it much better.
- All new features, fixes, and improvements are developed in separate “feature” branches. Â Most of these are branched off the master. Â For large chunks of work, we can create a feature branch, and then introduce incremental changes to it via sub-feature branches, branched off the feature one. Â This allows for easier code reviews – looking at a smaller set of changes, rather than a giant branch when it’s ready to be merged.
- We do code review on everything. Â The strongly suggested rule is that at least two other developers review the code before it is merged. Â But sometimes, this is ignored, because either the changes are small and insignificant (CSS tweaks or content typos), or we are really in a hurry (we’ll review the changes later). Â But whatever the case is, nobody is allowed to merge their own pull requests. Â That is set in stone. Â This guarantees that at least one other person looked at the changes before they were merged in.
- We tag new versions only on the master branch.
- We use semantic versioning for our tags.
- We don’t deploy branches.  We deploy tags.  This helps with preventing untested/unexpected changes sneaking in between the review of the branch and the deployment.
The above process suits us pretty well.