# Protecting the Main Branch — GitHub Fundamentals: Collaboration, Pull Requests and Actions

Source: https://www.skillbyai.com/en/github/gh-branch-protection

> Protect main with branch protection rules that require reviews and passing checks before merging.

## Why protect main

**Branch protection rules** (or newer **rulesets**) stop force-pushes and direct commits to `main`, requiring changes to go through a reviewed pull request.

## Required reviews & status checks

You can require at least one approval and passing CI checks before a PR is even allowed to merge.

## Where to configure

Settings → Branches → Add rule — pick the branch pattern (e.g. `main`) and the requirements to enforce.
