Highly opinionated. This works for my use cases. Some parts assume that GitHub Actions are used.
- Ensure "Allow merge commits" is unchecked
- Ensure "Allow squash commits" is unchecked
- Ensure "Allow rebase commits is checked
- Ensure "Always suggest updating pull request branches" is checked
- Ensure "Allow auto-merge" is checked
- Ensure "Automatically delete head branches" is checked
Ensure there's a branch protection rule for main
. Press "Add branch protection rule" if there's none.
- Ensure "Branch name pattern" is "main"
- Ensure "Require approvals" is unchecked
- This works well for one person projects or small teams with a high trust level
- Ensure "Require status checks to pass before merging" is checked
- Ensure "Require branches to be up to date before merging" is checked
- Search for appropriate status check(s), for example:
build
ortest
. This assumes that the GitHub Actions workflow is alread pushed to the repository and was run at least once.
- Ensure "Require linear history" is checked
Remember to press "Create" or "Save changes"!