Reputation: 9695
I noticed this question about rebase vs merge, but none of the answers there really gave me a solid feeling of knowing what to do about my own situation.
The scenario. Lets say there are 2 branches:
master
: branch currently living on productiondevelop
: non deployed branch developers do feature work off ofIf a change/hotfix if applied directly to master
in order to resolve a critical production issue, what is the best way to get the develop
branch synched back up with this change? What are the tradeoffs between:
master
into develop
(squashing into 1 commit)develop
onto master
Does the answer to this question depend on the number/extent of the hotfix applied? (1 hotfix commit vs 15 "hotfix" commits).
Upvotes: 2
Views: 1207
Reputation: 38116
The answer is not depend on the number of hotfix but the situation you used.
For your situation, develop
branch is used for all developers, so you’d better merge master
into develop
and not use rebase. And other developers just need to pull the merged commit from remote develop
branch.
Rebase is mainly use the branch is a private/local or at least other developers not use it recently. If you rebase develop
branch onto master
, this will make other developers work in mess.
Upvotes: 3
Reputation: 50119
the linked answer lists all the tradeoffs just fine.
In the end it is an opionated case by case decision. This 'special case' might be opinionated even more.
my intuitive OPINIONATED recommendation would be to merge master into develop as to not break anything or alter the branch..
Upvotes: 0