From the course: GitHub Quick Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Protect your repo branches

Protect your repo branches - GitHub Tutorial

From the course: GitHub Quick Tips

Protect your repo branches

- [Instructor] By default any pull requests can be merged by any user at any time. But there's a way to create a protected branch that helps you control how this works. So let's go to settings in our project and then we'll click on branches and we'll scroll down here to branch protection rules. Now you can add a rule by clicking right here and there's a lot of options for controlling how people are allowed to use certain branches. First though, you need to create a pattern to match. So this uses a standard Linux matching pattern. So you can type in something like star dash protected. If you have a branch that ends with a dash protected keyword. Now we can protect the master branch if we want to by just typing the name of the branch here. And then we can specify how we want this branch to be protected. Let's go ahead and require pull request reviews before merging. And let's go ahead and hit create to create this rule.…

Contents