First off, sorry if this is a duplicate, but I tried searching and all I could find was stuff on how to make branches in Git and whatnot. That's not what I'm looking for so much; I'm trying to figure out how different people out there setup their Git branches to match their workflow.
Let me give you an example of how our company does it:
- Developer commits to their own branch, locally
- Developer pushes commit to their remote, where a continuous build system checks it and another developer reviews it
- If the review/build passes, the commit is merged in to a QA branch (if it fails, more commits are made until the review/build passes)
- If the commit fails QA, a revert commit is made to get it out
- After enough QA commits are ready, our master branch gets the commits (the QA branch is based off it so no merges are needed)
- Periodically branches are taken from the master branch, and used to release "in to the wild". If problems are found here, a revert commit will again be used to remove the code
- After a release, developers rebase their branches on to the master branch (getting both their previous commits and those of other developers)
Now, there are some problems with this system; I'll note a few in the comments, but I'm not really looking for "please fix our system for me", I'm just trying to see what other branching options we could be using instead, so that I can weigh the various possibilities.
So, if you have worked at multiple companies that use Git (or even better, if you're some kind of consultant who has seen tons of Git setups), could you please share: how do different companies setup Git branches (and move commits between them) to facilitate the various stages of development ... all while trying to be as minimally annoying as possible? I'm sure there must be some common patterns ... but I have no idea what they are.
P.S. If you've only seen one Git setup, but you think it's interesting, by all means please post it. However, I'd like to award the answer to whoever provides the best breakdown of possible options, and I expect that would come from someone who has seen several Git setups.