Skip to content
Discussion options

You must be logged in to vote

Hi @akileus0000,

Here're some steps to do that:

Go to Your Repository Settings
Navigate to your repository on GitHub.
Click on Settings.
Branch Protection Rules

In the left sidebar, go to Branches under Code and Automation.
Click on Add branch protection rule.
Set Up the Rule for Your Main Branch (e.g., main or master)

In the Branch name pattern, enter your default branch name (main or master).
Enable Required Settings

Check Require a pull request before merging.
Enable Require approvals (you can set it to at least 1 approval).
Disable Allow force pushes.
Disable Allow deletions.
Restrict Who Can Push to Matching Branches

Scroll to Restrict who can push to matching branches.
Add only the …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@akileus0000
Comment options

Answer selected by akileus0000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pull Requests Propose, review, and discuss changes to a repository's codebase Question Ask and answer questions about GitHub features and usage
2 participants