Azure devops merge type for release branch
Asked Answered
T

1

5

I am just about to merge my release branch into master with an on-premises Azure DevOps environment. When I go for completing the Pull Request I am given four merge types options:

  • Merge (no fast-forward)
  • Squash commit
  • Rebase and fast-forward
  • Semi-linear merge

I would prefer keeping all my history intact, making sure to minimize issues on hotfixes or future release branch. I am trying to follow the git-flow process.

Usually I would use a Rebase with fast-forward, however (when I select "Squash") a message on the screen says:

"Consider using a no-fast-forward merge if you plan to use the sourcfe branch for future work".

What does that mean? Is Rebase with fast-forward not safe?

Thanks for you advice.

Tammara answered 31/8, 2021 at 13:40 Comment(0)
V
9

As a rule of thumb, if your source branch has merge commits that you wish you to retain, then the only merge type you should choose among those 4 is the first one, "Merge". In Git-Flow, merging any protected branch into another would always necessitate a regular merge. (release or hotfix into master or develop, etc.) The reason is any of the other 3 merge types will "pop" the merge bubbles and you'll lose the information provided by the merge commits.

Note you can still use semi-linear merge for feature branch merges into protected branches, in fact I personally prefer that when using Git-Flow. Here are some more details about when you can and can't use semi-linear merge.

Vestal answered 31/8, 2021 at 14:40 Comment(1)
fantastic clarification, thanks a lot for this.Tammara

© 2022 - 2024 — McMap. All rights reserved.