-1

By default github provides three ways to merge a PR to a branch:

  1. Merge Commit
  2. Squash and Merge
  3. Rebase and Merge

Can we add some branch rule or is there any way we can restrict them and allow only one or two options for any given branch.

Hardik3296
  • 336
  • 2
  • 14

1 Answers1

0

To restrict these options to all branches

You can go to your repository Settings > General, and disable these options as necessary.

GitHub Repository settings

To restrict these options to a certain branch

This is currently not supported by GitHub, as evident from the ongoing discussion at: https://github.com/orgs/community/discussions/10809

Robin Thomas
  • 1,317
  • 8
  • 15