How do you enforce a branch naming convention like `feature/ABC-123-short-name`?
BeginnerScenarioBranching Strategies and Releases
Answer
Situation read → Convention only works when it is checked automatically.
What I'd do →
- Document the pattern in
CONTRIBUTING.md. - Add a push ruleset or branch-name rule (rulesets support "branch name pattern" restrictions) to reject non-matching names.
- Or a CI check on the PR head ref.
- Link tickets automatically using the ID from the branch name.
Why → Consistent names help tooling, such as Jira linking and release notes.
Interview tip → Do not over-engineer; PR titles matter more than branch names.
More on Branching Strategies and Releases
An eight-person team deploys several times a day. Which branching strategy do you recommend?IntermediateWhen would you choose GitFlow over trunk-based development?IntermediateIn trunk-based development, a feature will take three weeks. How do you merge it daily without exposing it?IntermediateYou are cutting a release. How do you manage the release branch and late fixes?IntermediateShould releases use lightweight or annotated tags?BeginnerA release tag was placed on the wrong commit and has been published. What do you do?Intermediate