rrt branch
rrt branch
Section titled “rrt branch”Branch command helpers and utilities for conventional branches.
Overview
Section titled “Overview”The rrt branch command family provides a suite of helpers for managing
semantic, conventionally-named Git branches. By enforcing a consistent naming
structure—such as feat/add-parser or fix/config-loader—the tool ensures
that the repository’s branch history remains searchable, readable, and
aligned with standard conventional-commits policies.
These helpers are particularly useful for teams practicing trunk-based development, where branch names often serve as the primary signal for automated release notes and CI workflow routing.
Responsibilities
Section titled “Responsibilities”- validate branch names against project-specific prefix and slug rules
- scaffold new branches using the canonical
<type>/<kebab-slug>format - automate the renaming of branches while preserving description context
- “rescue” uncommitted work or divergent commits into new, semantic branches
- provide actionable suggestions when a branch name violates repository policy
Standard Format
Section titled “Standard Format”<type>/[<scope>-]<kebab-case-description>Example branches:
feat/add-config-discoveryfix/handle-tag-workflowsdocs/split-readme-into-docs
Built-in branch types
Section titled “Built-in branch types”Conventional branch types are accepted out of the box:
feat,fix,chore,docs,refactor,test,ci,perf,style,build
Special names
Section titled “Special names”These branch names are also valid:
main,master,develop- release branches built from each version group’s
release_branchtemplate (defaultrelease/v<version>), with a SemVer, PEP 440 or CalVer version
AI helper and Bot branches
Section titled “AI helper and Bot branches”Branches created by assistant-driven workflows or dependency bots are accepted with these prefixes:
claude/...,codex/...,copilot/...dependabot/...,renovate/...
Custom branch and commit types
Section titled “Custom branch and commit types”A repository defines its own types in [tool.rrt]. Each table entry is a full definition:
[[tool.rrt.commit_types]]name = "security"description = "Security fix or hardening"changelog_section = "Security" # false keeps it out of the changelogbump = "patch" # none | patch | minor
[[tool.rrt.branch_types]]name = "design"description = "Design records and decisions"commit_types = ["docs", "chore"] # omitted allows any commit typeslug = "kebab" # kebab | anyAn entry with a built-in name overrides only the fields it sets. Hooks, MCP
validators, changelog rendering, bump inference and rrt branch new read the
same definitions. On a design/... branch the commit-msg hook rejects any
type outside commit_types. The flat extra_branch_types and
extra_commit_types lists stay as shorthand. rrt config lists every
resolved type with its description.
Behavior
Section titled “Behavior”- new: Creates and switches to a new branch. Moves dirty changes if requested.
- rename: Rebuilds the current branch name based on new type, scope, or description.
- rescue: Moves commits ahead of upstream to a fresh semantic branch.
- dry-run: Previews all Git operations without modifying the repository.
Examples
Section titled “Examples”rrt branch new feat "add parser"rrt branch new fix "repair config loader" --scope apirrt branch rename --type fix --scope api "fix config loader"rrt branch rescue feat "rescue work in progress"
Caveats
Section titled “Caveats”- Branch slugs are limited to 60 characters by default.
- Custom branch types can be added via configuration.
- Agent and bot prefixes are accepted by the hooks but never created by
rrt branch new.
Related docs
Section titled “Related docs”Badge families are intentionally complete for the current icon registry across platform, registry, and language labels; see src/repo_release_tools/tools/platform.py if you think one is missing.
Chat is powered by Context7, a third-party service with its own terms and privacy policy.