Using git flow it's noted that
hotfix branches are branched from
master and merged back to both
However, it's plausible that merging
develop will cause merge conflicts, which is why my team is currently advocating to merge
master and then back from
But I think that the scenarios that will create conflicts from
develop would also yield conflicts on
develop, so there's no real benefit here.
Even worse, because they always resolve conflicts inside GitHub Pull Requests, if there's a conflict from
develop they'll create a commit on
master solving it before merging to
After all, are these non-issues? Is merging from
hotfix to both
develop really that important or is the second approach equally fine?
The two approaches are functionally the same most of the time, in practice.
1 # last common commit |\ | \ | \ | \ v \ 2 3 # master follows left side commits, develop follows right side |\ /| | \ .| | | | |. | | v/ | | 4 | | # 4 merged into master from feature branch, contains 3 | | | | v | | 5 | # hotfix commit 5 | /| | v/ | | 6 | | # 6 fixes conflicts between 3 and 5 | \ | | \v | A # A also fixes conflicts between 3 and 5 \ \ . \ | \ | \v B # merge master with hotfix to develop
So your possibilities to merge to develop in A or B are that A will contain commits (1, 2, 3, 5) and B will contain (1, 2, 3, 4, 5, 6). There could be anything in 4 or 6 that is not desirable on the develop branch for whatever reason, but in practice I don't see what that could be.
Assuming commit 4 comes from some change on develop (already is on develop), then it is possible that commit 5 and commit 4 have merge conflicts. In that special case, the conflict would have to be resolved in both 6 and A, whereas merging into B would allow to resolve those conflicts only once in 6. Solving conflicts twice also has the potential of solving them (slightly) differently, causing further merge conflicts in the future.