I can enforce a merge strategy per project, but we need to change the merge strategy at the branch level. We can allow multiple strategies, but the person who does the merge has to be diligent in selecting the correct one. This is most problematic when merging a long-running development branch into our master branch. We squash PR's to the development branch, but we don't want the PR from development to master to be squashed. Relying on the person who is charged with merging from development to master to make that proper choice has not worked out so well for us.
How can we enforce a merge strategy on a per-branch basis?
Any built in support for this in Bibucket Server? We also need to prevent squashes to certain branches, as squashes of branches that contain squashes are REALLY bad and cause of lots of merge headaches.
It's really the only deficiency in Bitbucket that we come across.
Our free add-on, Control Freak for Bitbucket Server, might be able to help you with this specific situation.
For the repo in question, set the following config:
Repo --> Settings --> Control Freak
Require Squashed Merges Into:
Override: Yes
[x] Default [x] Development [x] Production [x] Release Branches
And then click "Save Settings."
The neat thing about this setting is that while it forces squashes for all merges coming into those branches (based on the repo's branching model), merges *between* those branches do not require squashes.
You might also want to set Control Freak's "Require Fast-Forwardable Merges Into:" setting for the same branches, to force a squash + rebase workflow.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This looks *really* good. Demo-ing it right now.
I'm optimistic that it will get us where we need to be. Thanks vv much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It works particularly well with our other paid add-on, Bit-Booster Rebase Squash Amend, since that one puts a "Squash" button right on the pull-request screen.
Email us any time at: support@bit-booster.com.
Note: there's a bit of an implied assumption in the Control-Freak solution for this problem. The implied assumption is that "--ff" merge is your default merge option (not "--ff-only"), since it will nicely accept the "fast-forward" on the squash, but nonetheless allow the regular merge for the longer lived branches.
BUT if you've set "--ff" to your default merge option, then you really want to disable foxtrot merges as well, because "--ff" merges and foxtrots make a mess of the commit graph.
LUCKILY Control-Freak has that covered:
Block Foxtrot Merges On:
[x] Default [x] Development [x] Production [x] Release Branches [x] Hotfix Branches
[x] Bugfix Branches [x] Feature Branches [x] All Others
(We recommend enabling this block for all branches).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.