Protected branches and required status checks

Image of Ben Bleikamp

It’s all too easy to force push to the wrong branch, overwriting someone else’s changes with your own. Sometimes it results in losing work (unless you know how to undo almost anything in Git).

Over the next few weeks we’ll be rolling out a new feature called Protected Branches which gives repository administrators the ability to disable force pushes to specific branches. When it’s enabled for your repositories you’ll be able to go to the Branches tab in repository settings and protect branches:

Repository Branches settings page

In addition to blocking force pushes, a protected branch can have required status checks. Required status checks make integrations that use our Status API enforceable and you can disable the merge button until they pass:

Pull Request merge area with required status checks

When using required status checks, your branch must be up-to-date to ensure your tests will pass after merging. The new “Update branch” button lets you merge the latest changes from the base branch of the Pull Request with one click.

Pull Request merge area with Update branch button

See what launched at GitHub Universe

Missed the main event? Learn more about everything that launched at GitHub Universe, from GitHub for mobile and a redesigned notifications experience to the GitHub Archive Program.

Read the day one keynote recap

Secure the world's code, together

On day two of GitHub Universe, we announced GitHub Security Lab, bringing together security researchers, maintainers, and companies across the industry to secure open source.

Read the day two keynote recap