Protected branches and required status checks
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…
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:
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:
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.
Written by
Related posts
Celebrating the GitHub Awards 2024 recipients 🎉
The GitHub Awards celebrates the outstanding contributions and achievements in the developer community by honoring individuals, projects, and organizations for creating an outsized positive impact on the community.
New from Universe 2024: Get the latest previews and releases
Find out how we’re evolving GitHub and GitHub Copilot—and get access to the latest previews and GA releases.
Bringing developer choice to Copilot with Anthropic’s Claude 3.5 Sonnet, Google’s Gemini 1.5 Pro, and OpenAI’s o1-preview
At GitHub Universe, we announced Anthropic’s Claude 3.5 Sonnet, Google’s Gemini 1.5 Pro, and OpenAI’s o1-preview and o1-mini are coming to GitHub Copilot—bringing a new level of choice to every developer.