Branch protection won't enforce push rules - Any ideas? pen_spark

Hi everyone,

I’m setting up branch protection for a new project and I’m encountering a strange issue. I’ve configured push rules to require at least two approvals before a push can be merged into the main branch. However, I’m still able to push directly without any prompts for approval.

I’ve double-checked the protection settings and everything seems to be in order. I’m using GitLab [insert your version number here] (if applicable).

Has anyone else come across this behavior? Any advice on troubleshooting or what I might be missing?

To require approval for changes to your product, make sure “Allowed to push and merge” is set to “No one” and the ability to force push is toggled off.

Approval requirements only work with merge requests, and making it such that “no one” can push to a protected branch will ensure that all changes must be made via a merge request. Otherwise, if “Allowed to push and merge” is set to “Maintainers” (as is the default), then project maintainers will have the ability to push directly to the protected branch, bypassing the approval requirement.