Git repos and protected branches

Erik Helin erik.helin at
Fri Oct 9 12:03:02 UTC 2020

On 10/9/20 12:44 PM, Aleksey Shipilev wrote:
> Hi,
> I was wondering if repos configuration had changed recently.
> I have been using self-PRs in JMH repo to get tests running:
> ...but I cannot delete the branch after I am done with it:
> $ git push origin --delete gh-actions
> remote: error: GH006: Protected branch update failed for 
> refs/heads/gh-actions.
> remote: error: Cannot delete this protected branch
> To
>   ! [remote rejected]   gh-actions (protected branch hook declined)
> error: failed to push some refs to 'git at'
> Is this something expected? Are we expected not to use/delete branches 
> in Git repos? Or are we supposed to only use branches in our private forks?

We have fairly strict branch protection rules by default, including 
disallowing you to delete branches in the upstream repository 
(openjdk/jmh in this case). This policy stems from the jdk repository 
and the only reasons that openjdk/jmh has the same branch protection 
rules is because we use the same defaults when setting up repositories.

We are happy to either:

- delete the branch for you
- allow users with direct write access to delete branches in the
   openjdk/jmh repository

Feel free to reach out to me and/or Robin off-list and we can help you out!


More information about the skara-dev mailing list