'Best way to merge the same feature to other branches
I have a terraform repo which has master, release, and develop branches. Each of the branch represent an environment (Dev, QA, Prod).
We manage changes or enhancement through feature branch. Question is after a new feature merged to develop branch, should we continue merging the same feature to release and master, or we should merge develop to release, and then merge release to master. Looks like either way will get the same the codes across all branches, but like to understand what's the best way for doing this. Thanks for any comments.
Solution 1:[1]
There are two components to your questions. "What happens technically in Git?" and "What is a good work flow?" The first one is objective and you have answered yourself, and the second one is subjective as it is a matter of preference to which there is no right or wrong in Git. Stackoverflow is better suited for objective technical questions.
However, I am happy to give you my subjective personal preference which comes from GitFlow. Again, this is a workflow and not how Git works.
Create feature from develop. Once the new feature is done, merge feature to develop and then delete feature. Once you are ready to do a new release, then create release from master and merge develop to release. Do QA in release. Then merge release into master and then delete release. Then rebase develop to master and repeat.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | TheIceBear |
