GJ.
GJ.

Reputation: 870

Master and develop branch never synced even follow git-flow process in bitbucket

I am following git-flow branching model with my repo hosted on Bitbucket Cloud.

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

Answers (1)

GJ.
GJ.

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

Related Questions