Disable "Squash and merge" on some specific branches #10809
Replies: 383 comments 95 replies
-
+1. same exact use case. there are so many options in the "Branch protection rules" I was surprised this wasn't one of them (and also it seems like a good place to hang this feature) |
Beta Was this translation helpful? Give feedback.
-
+1 We want to enforce We have resorted to using memes to try to get everyone to remember to apply the right merge type for the right branch:
|
Beta Was this translation helpful? Give feedback.
-
+1 This seems like a pretty normal use case. |
Beta Was this translation helpful? Give feedback.
-
+1 I really would like to set merging strategies per branch – same way as it is possible now for the whole repository. For benchmark: Azure Repositories does it really well. Other things are far worse, but this is where they're superior in my opinion. |
Beta Was this translation helpful? Give feedback.
-
+1 Our team would like to configure merge strategy for each branch separately as well |
Beta Was this translation helpful? Give feedback.
-
Yes, this keeps biting us as well. GitHub... please hear our cries! |
Beta Was this translation helpful? Give feedback.
-
Branch protection rules appears to be the right place to define this. Github, please reach out if you are looking for beta testers for this feature request. ;-) |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot those who showed interests in this feature request! |
Beta Was this translation helpful? Give feedback.
-
This would be a great feature. The number of times people on our team accidentally squash merge to master, then I'm forced to resolve conflicts on develop...urgh! |
Beta Was this translation helpful? Give feedback.
-
It persists the button as whatever last one you used, which makes this really easy to flub. Then the poor sucker who has to do the next merge into the deploy branch has a mess to unravel. |
Beta Was this translation helpful? Give feedback.
-
Yeah, this feature would be great. |
Beta Was this translation helpful? Give feedback.
-
yes please allow specify merge strategy per branch protection rule... |
Beta Was this translation helpful? Give feedback.
-
+1 exact same use case. Surprising that it hasn't been considered for so long. |
Beta Was this translation helpful? Give feedback.
-
+1. We've been promoting branches associated with environments so dev->stg->prod and it would be great to enforce squash merge into dev and disable squash merge for stg and prod. |
Beta Was this translation helpful? Give feedback.
-
+1 need this |
Beta Was this translation helpful? Give feedback.
-
Migrating from Azure DevOps to GitHub and surprised to see this not supported. +1 |
Beta Was this translation helpful? Give feedback.
-
Wild that this has taken so long. |
Beta Was this translation helpful? Give feedback.
-
+1 Just had to resolve like 20 commits worth of merge conflicts because of a Dev -> Main squash commit, Github plz |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm now building a deploy workflow for a monorepo, and trying to set up a CI workflow triggered by a push to a special branch (like
production
) for deployment. We currently merge regular PRs to the main branch using "Squash and merge" by enabling "Require linear history" option, and merging "deploy" PRs to the production branch with "Create a merge commit" in order to avoid unexpected divergent.It works, but not perfect because "Squash and merge" button is present when merging a PR to the production branch.
As far as I searched, I couldn't find a good way to enforce developers to use "Create a merge commit".
Is there a good way to achieve that?
So far, I could find a stackoverflow saying it's not possible.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions