Can I specify branch PR rules in GitLab? is this a job for .gitlab-ci.yml?

I want to provide branch merging rules for a repository, specifically:

  • Any branch can merge into dev
  • dev can only merge into staging
  • staging can only merge into main.

Currently I have to remember to change the branch names before I merge a PR. This has caused issues on more than one occasion where I forgot to. I’d like to provide guard rails.
I don’t care about setting up a CI/CD pipeline. I only want to provide rules for merging. The only thing I see is rules about what users can do a PR merge with/without approval.

Any suggestion for this?