Pull Request and Merge #148108
-
Select Topic AreaQuestion BodyHi, I'm gonna invite someone to our repo to make some changes on that. However, I would like to make him only enable to create a new pull request on github, but not merge feature. How should I do this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @akileus0000, Here're some steps to do that: Go to Your Repository Settings In the left sidebar, go to Branches under Code and Automation. In the Branch name pattern, enter your default branch name (main or master). Check Require a pull request before merging. Scroll to Restrict who can push to matching branches. Click on Save Changes. Go to Settings → Collaborators and Teams. |
Beta Was this translation helpful? Give feedback.
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 …