Projects should use main as the default branch (modern GitLab convention since 2021). Standardising on main simplifies CI templates, branch-protection rules, and inter-project automation. Use the GL_Project_DefaultBranch_Should_Not_Be_Master rule for the inverse formulation.
1. Go to project Settings > Repository > Default branch. 2. Set Default branch to main. 3. Save changes. 4. Update local clones via: git remote set-head origin -a.
{
"target": "GLProject",
"if": {
"allOf": [
{
"resource": "GLProject",
"property": "DefaultBranch",
"operator": "equals",
"value": "main"
}
]
},
"then": {
"effect": "Audit"
}
}
Copyright © DevOps Shield. All Rights Reserved. Privacy Policy | Cookie Policy | Terms and Conditions | v1.0.2