DevOps / Gitlab Interview questions
What are protected branches in GitLab?
A protected branch in GitLab is a branch, most commonly main or a release branch, that has extra restrictions applied so it can't be force-pushed, deleted, or pushed to directly by anyone below a chosen permission level.
Protection rules are configurable per branch or wildcard pattern (like release/*) and can independently control who is allowed to merge into it versus who is allowed to push directly to it, typically restricting direct pushes to Maintainers or nobody at all so every change has to go through a merge request.
This is the mechanism that actually enforces a code review workflow; without it, developers with write access could bypass merge requests entirely and push straight to production branches.
More Related questions...