-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require squash-merging for master branch? #52985
Comments
In the repo settings, we have the ability to disable regular (non-squash) merging. This would then force everyone to always use squash merging. As far as I can tell, there's no way to set the default to be squash-merging but still allow users to regular merge if they really want. |
Where is that setting? Non-squash merging seems to be so rare that I think it would be fine to require an admin to go in and change that setting, then do the regular merge, then change the setting back. |
It's in the repo settings. Control-F the general repo settings page for the checkbox labeled "Allow merge commits", and uncheck that checkbox. If we want to try it out as an experiment, I can uncheck that checkbox. |
Great, I didn't see that! We should also uncheck "Allow rebase merging", so that squash merging is the only option. |
This is already done. |
The "Git Recommendations For Pull Request Reviewers" section of the |
These are the PRs with label |
Regarding rebase merge, I have a request open for GitHub to add the option to link back to the PR in the rebase merge commits, like it does for squash merges, which is currently a reason why rebase merge shouldn't be used at all for this project https://github.com/orgs/community/discussions/62118 With that change it would become the preferred non-squash approach, I think |
Yeah GitHub stack PR support is not great so sometimes not squashing is the preferred course of action. |
Is it possible to set the
master
branch to disable merging without squashing by default?See instructions at: https://github.com/orgs/community/discussions/50593#discussioncomment-5402508Unfortunately, the linked instructions appear to be wrong. But is there another way to do it? At the very least, it seems we could require linear history.Merging without squashing is something that should only be done in exceptional circumstances — not only does it clutter the commit history, but it also potentially merges commits that are in a broken state, breaking
git bisect
. But right now, it is way too easy to do by accident (e.g. see #52777).As was commented in #52777, at the very least this should be in the developer docs somewhere.This policy is documented in the "Git Recommendations For Pull Request Reviewers" section of the CONTRIBUTING.md guide, which should be updated if there is a change in repository settings.The text was updated successfully, but these errors were encountered: