What are protected branches/variables and environments in GitLab CI?
⚡
Quick Answer
Protected branches restrict who can push/merge; protected/masked variables limit secret exposure; environments track and gate deployments.
Detailed Answer
Mark production secrets as protected (only available on protected branches) and masked (hidden in logs). environment: production records deploys, enables manual approval, and supports rollback. Together they keep prod credentials and deploys locked down.
💡
Interview Tip
Protected + masked variables is the secret-handling answer.
gitlab-cienvironmentssecrets