What is the correct process for merging hotfix changes into multiple release branches (ie: dev/staging)?

50 Views Asked by At

I'm wondering what is the correct way of getting a hotfix into various main release branches which ensures Git history for these branches are more aligned and Git history is consistent?

I have the following main branches setup:

  • release/dev - shared dev team testing environment
  • release/staging - QA team testing environment
  • release/uat - wider company testing environment
  • release/production - production

A developer creates a feature branch (feature/myfeature) from release/dev and then merges it into release/dev. When a 'release' has passed dev testing, release/dev is merged (via PR) into release/staging to allow QA to do testing. Once QA testing passes, release/staging is then merged (via PR) into release/uat to allow the greater company to do final testing. Once it's fully approved, release/uat is merged (via PR) into release/production.

Along each step, hotfixes/bugfixes/changes can be made. I'm using bitbucket, and if a fix is applied to staging/uat/production, I use the 'Sync' button to "sync downwards" the changes into each of the other main release branches.

Example:

  1. hotfix/mybug is merged (via PR) into release/production
  2. release/production is merged into release/uat via the 'Sync' feature
  3. release/uat is merged into release/staging via the 'Sync' feature
  4. release/staging is merged into release/development via the 'Sync' feature

The problem I see is that the lower branches start to have more Git history due to the 'syncing' and this makes things appear to be ahead/behind even though they have the same code.

Therefore, I'm wondering if there is a more correct way of getting commits applied at higher up branches (staging/uat/production) into the lower branches which wouldn't cause Git history differences? Such as, should I be PRing the hotfix branch into each of the main release branches instead of only release/production and syncing?

0

There are 0 best solutions below