Reputation: 870
I am following git-flow branching model with my repo hosted on Bitbucket Cloud.
feature
branches (branched out from develop
) which are merged into develop
branch via PRsrelease
branch from latest develop
;master
into release
; (I will have to perform this step as explained later)release
into master
via PR.hotfix
branch from latest master
;hotfix
into master
via PR.bugfix
branch from latest master
;bugfix
back into develop
via PR.I have been following the above procedures strictly. However, the master
and develop
are never synced, even right after a release, the indicator on Bitbucket Cloud branches page tells me the master
branch is "99 commits behind develop" and "11 commits ahead of develop".
Every time when doing a release, Bitbucket Cloud always tells me that the two branches are not in-sync (even I have not done any changes to the master
branch after the previous release), hence I have to perform step 2 of the release procedures above. This step becomes harder and harder as it keeps adding back files that has been removed from develop
(and should have been removed from master
as well) during the merge process.
I'm not sure what I have done wrong. Can anyone suggest?
Upvotes: 1
Views: 1436
Reputation: 870
As @matt pointed out in the comments above, the root cause of develop
and master
branches never in-sync is because I have always been using "squash and merge" in the Bitbucket PR.
I just performed a release (develop
-> release
-> master
) by merging the release PR into master
using "explicit merge" (non fast-forward), and now develop
and master
branches are in-sync.
For the different merge policies, ie. explicit merge (non fast-forward) vs implicit merge (fast-forward) vs squash and merge, one can refer to this article Pull Request Merge Strategies: The Great Debate for a high level discussion of the differences. I found the GIFs very helpful.
Upvotes: 1