Git workflow guides

Review a Branch List Against a Ticket Convention

·

Git can accept a branch that your team asks you to rename. Review raw branch syntax alongside local policy so you can tell which rule you need to fix.

Branch Name Convention Validator

Check three branch cases and the protected name

Select Load the OPS example, then Check branch names. The example sets the ticket policy, keeps the length limit at 80, allows the five default protected names and requires lowercase outside the ticket token.

The report reads 2 passed and 2 failed. The uppercase OPS ticket passes the regex. The second line gets a policy finding for its capitalized description. The double slash in the third line is a Git syntax finding. The fourth line is an allowed protected name. In branch-report.json, check policyIssues on line 2 and gitIssues on line 3.

Check three branch cases and the protected name
Branch nameResult
feature/OPS-42-add-checksPass
feature/OPS-7-Add-ChecksPolicy: Use lowercase outside the ticket token.
bugfix//repairGit: Empty slash component
mainPass

Open the validator and load the OPS exampleGit check-ref-format reference

Review what changes when you adjust the policy

Clear Allow protected names and run the same list to flag main. To check a different ticket system, edit Ticket regular expression. The default matches an uppercase project key of at least two characters, a hyphen and a numeric ticket number.

The Git Flow profile expects feature, bugfix, hotfix, release or support followed by a slash and branch details. The prefix and kebab-case profile expects one hyphen-separated description after an allowed prefix. Custom regular expression matches the entire literal name. The optional lowercase rule still applies.

Open the validator and load the OPS example

Confirm the name in the relevant repository

The report checks up to 500 lines locally. It preserves each literal branch string in its result. Blank lines are skipped. A regex check is limited to three seconds and can also be canceled.

Use git check-ref-format --branch for Git's own check in your repository, and verify name collisions and protection settings there. The local report evaluates literal names. Checkout shorthand such as @{-1} requires repository context.

Git check-ref-format reference

Common questions

Does a space at the end of a pasted branch get ignored?

Spaces in a nonblank input line are preserved. Git rejects an ASCII space in a branch name, including at the beginning or end.

Do I include slash delimiters around my custom regex?

Enter the JavaScript pattern without enclosing slashes or flags. The validator applies it to the whole branch name.

Sources and example

Put it into practice.

Related guides