Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

I would like to enforce a merge strategy on a per-branch basis in Bitbucket

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?

2 answers

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.

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!

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:

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).

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

291 views 2 10
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you