Branch/Commit Naming Checker

Validate your Git branch names and commit messages against custom rules to maintain a clean and readable version history.

How to Use

1

Define Your Rules: Enter the regular expression patterns you want to enforce for branch names and commit messages.

2

Enter Your Names: Type or paste the branch name and commit message you want to test.

3

Check Validity: The tool will instantly tell you if your names are valid according to the rules you've set.

Branch Naming Rule

Branch Name to Test

Commit Message Rule

Commit Message to Test

Enforcing Sanity in Your Repository

A well-organized Git repository starts with consistent naming. When branch names and commit messages follow a predictable pattern, it becomes trivial to understand the history of a project, automate release notes, and quickly identify the purpose of any change. This tool helps you test and enforce those patterns.

Common Use Cases

Validating Branch Names

Ensure new branches follow a convention like `feature/TICKET-123` before you start working.

Checking Commit Messages

Verify that your commit messages adhere to the Conventional Commits specification for automated changelog generation.

Learning Regular Expressions

Use the tool as a live playground to test and learn how regular expressions work for validating strings.

Team Onboarding

Show new team members how to correctly name their branches and format their commit messages according to your project's standards.

Frequently Asked Questions

Why are consistent branch and commit names important?

Consistent naming conventions for branches and commits make your Git history much easier to read and understand. It helps developers quickly see what a branch is for (e.g., `feature/add-login-page`) or what a commit does (e.g., `feat: add user authentication`).

What is a good branch naming convention?

A popular convention is `type/ticket-number/short-description`, where `type` is something like `feature`, `fix`, or `chore`. For example: `feature/TICKET-123/add-user-profile`.

What is Conventional Commits?

Conventional Commits is a specification for adding human and machine-readable meaning to commit messages. It follows the format `type(scope): description`. For example: `feat(auth): add password reset flow`. This tool can help you validate against this specification.

How do I use regular expressions (regex) for validation?

Regular expressions are powerful patterns for matching text. For example, to enforce that a branch name starts with `feature/` or `fix/`, you could use the regex `^(feature|fix)/.+`. This tool lets you test your names against any regex pattern.

Can I use this in my CI/CD pipeline?

This online tool is for manual checking and exploration. To enforce these rules automatically in a CI/CD pipeline, you would typically use a script or a dedicated Git hook that runs a similar regex check on branch or commit names.