We're migrating from TFS to Git (Azure DevOps) and I'm not clear on the best strategy for the following scenario:
We have two Stories in a Sprint.
- PBI-1: Add functionality XYZ
- PBI-2: Extend functionality XYZ
Note:
- Each PBI will be quite "large", i.e. involve multiple Commits and may involve multiple developers
- PBI-2 is obviously dependant upon PBI-1, and can't start until PBI-1 is completed
Also note:
- We have a policy on our 'develop' branch that all code must be Approved by the Approver before it can be merged in
- When merging to 'develop' we do a "squash merge" and then the source branch is automatically deleted
Okay, so from what I've read, it seems to me that each PBI ought be on its own "Feature Branch" (created from the "develop" branch). That being the case, then I'm guessing:
At the start of the Sprint, we'd create a new feature branch off of 'develop' called "Feature/Add-XYZ".
Multiple developers would then start work on this, with the usual flow of daily re-basing (note: see comment below regarding why not to use rebasing) from 'develop', regular Commits and Pushes to the server version of the branch "Feature/Add-XYZ" (on DevOps).
When all work on PBI-1 is complete and all code pushed to the server, a Pull Request would be created and sent to the Approver.
However, the Approver is very busy and may not get to the Pull Request for several days; we don't want this to be an impediment, so how should the team start on the next PBI bearing in mind:
- PBI-2 is dependant on code sitting in the branch "Feature/Add-XYZ"
- The branch "Feature/Add-XYZ" will be deleted as soon as the Approval Process is complete
My guess is that I'd:
- Create a new branch off of "master" called "Feature/Extend-XYZ" (this won't contain any code related to XYZ as that is still in the branch "Feature/Add-XYZ")
- I would then need to "copy" the relevant code from the branch "Feature/Add-XYZ" to "Feature/Extend-XYZ".
If this is the right way to go, then what is the recommended way to achieve step 2? Is it a simple "Merge From"?