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
GitHub Availability Report: November 2024
In November, we experienced one incident that resulted in degraded performance across GitHub services.
The top 10 gifts for the developer in your life
Whether you’re hunting for the perfect gift for your significant other, the colleague you drew in the office gift exchange, or maybe (just maybe) even for yourself, we’ve got you covered with our top 10 gifts that any developer would love.
Congratulations to the winners of the 2024 Gaady Awards
The Gaady Awards are like the Emmy Awards for the field of digital accessibility. And, just like the Emmys, the Gaadys are a reason to celebrate! On November 21, GitHub was honored to roll out the red carpet for the accessibility community at our San Francisco headquarters.