At my workplace, we are attempting to design a workflow based around Git to handle our deployments and changes to the code.
We have a Java EE web application and 3 deployment environments (Test, QA and Production). We also have an instance of Jenkins CI to handle builds and deployments.
When changes are made to the application's code (in branches) we need to be able to pick and choose which ones get promoted to QA and Production. Some might get to QA and then never go to production.
We also need to be immune to accidentally including everyone else's code in your branch when promoting and merging.
The "promotion" of branches needs to also be automated - in such a way that an analyst would select the branch or changeset and then jenkins or some other script would do the actual merging and deployment. I see merge conflicts being an issue here...
How would you recommend setting up (a) Git repository(ies) to handle these requirements?