Currently pull request merge options are set on a repository level. It would be fantastic if these could be set or overridden based on:
A) Where the pull request head branch lives, i.e. within the organization repository vs. a fork.
B) Branch name patterns, the same way branch protection rules works.
The reason behind this feature request is that merging between shared branches (i.e. within the org repo) should allow for blocking rebases and squashes, since these change the commit history & hashes. The Golden Rule of Rebasing calls these "public branches", but "public" can be a misnomer because orgs can have private repos, so "shared branches" describes them better.
Since fork feature branches are not typically shared/"public", it would be great to force either a rebase or squash. This benefit here is that squashing can save manual developer time in cleaning up commits (ex. manually rebasing), and rebasing allows keeping multiple commits intact without adding an empty merge commit.
These are some of the drivers behind using PRs to merge shared branches (ex. develop into master):
Hi @rjgwiz ,
Thanks for this feedback! We're always working to improve GitHub and the GitHub Community Forum, and we consider every suggestion we receive. I've logged your feature request in our internal feature request list. Though I can't guarantee anything or share a timeline for this, I can tell you that it's been shared with the appropriate teams for consideration.