Reputation: 909
Let's say, using Gitflow, that I have 2 branches, A and B, both off of develop, being worked on simultaneously.
A gets merged back into develop.
What I would like to happen is the following:
A PR gets opened to merge some feature onto B. If B is behind develop (which it would be now), I want the merge to be blocked, the same way it would if there was a conflict.
Is this possible? Is this a bad strategy? Is there a better way to do this in Git?
We're in a situation where we've been developing, then at the very end merge develop back into our feature branches and are left resolving a million conflicts. I want to find a way to force this up front. Can somebody help me figure out the right way to handle this?
If this is a duplicate please let me know, I didn't know the right words to search for this.
Upvotes: 2
Views: 1799
Reputation: 51
It sounds like you want fast-forward only on your merges.
It will stop the new PR until they rebase off of the new HEAD commit on branch B.
You can enable this in your repository settings.
https://confluence.atlassian.com/bitbucketserver059/pull-request-merge-strategies-949255012.html
You can automate this strategy with a hook, but you may have conflicts to deal with.
Upvotes: 2