Conventional Branch Naming Specification – Chinese Version
The article introduces the Chinese version of the Conventional Branch Naming Specification, explains its purpose, outlines branch prefixes and naming rules, provides examples, and lists tools for automatic compliance, offering a comprehensive guide for improving Git workflow readability and automation.
Last week the "Conventional Branch Specification" was officially released, and after receiving many inquiries about a Chinese version, the Chinese translation is now live.
Details can be found at https://conventional-branch.github.io/zh/ . The original version has also been slightly adjusted, and the full Chinese content is presented below.
Overview
Conventional branches refer to a structured and standardized naming convention for Git branches, aiming to make branch names more readable and operable. While suggested prefixes are provided, teams may define their own conventions. Consistent naming makes it easier to identify branch types.
Key Points
Purpose‑driven branch names : Each name clearly indicates its purpose, allowing all developers to understand the branch’s intent.
CI/CD integration : Consistent names help automation systems (e.g., CI/CD pipelines) trigger specific actions based on branch type, such as automatic deployment from a release branch.
Team collaboration : Clear purpose encourages collaboration, reduces misunderstandings, and makes task switching smoother.
Specification
Branch Prefixes
Branch names use the following prefixes: feature/ , bugfix/ , hotfix/ , release/ and chore/ . The structure should be:
<type>/<description>main : Main development branch (e.g., main , master or develop ).
feature/ : New features (e.g., feature/add-login-page ).
bugfix/ : Bug fixes (e.g., bugfix/fix-header-bug ).
hotfix/ : Emergency fixes (e.g., hotfix/security-patch ).
release/ : Release preparation (e.g., release/v1.2.0 ).
chore/ : Non‑code tasks such as dependency updates or documentation (e.g., chore/update-dependencies ).
Basic Rules
Lowercase and hyphen‑separated : Use only lowercase letters and separate words with hyphens (e.g., feature/new-login ).
Alphanumeric and hyphens only : Allow only a‑z, 0‑9 and hyphens; avoid spaces, punctuation, or underscores.
No consecutive hyphens : Ensure hyphens are not repeated (e.g., feature/new-login , not feature/new--login ).
No trailing hyphens : Do not end a name with a hyphen (e.g., feature/new-login , not feature/new-login- ).
Clear and concise : Names should be descriptive yet brief.
Include ticket numbers : When applicable, add issue or ticket identifiers (e.g., feature/T-123-new-login for ticket T‑123).
Conclusion
Clear communication : The purpose of code changes is evident from the branch name alone.
Automation‑friendly : Facilitates hooking automated workflows (e.g., for feature , release , etc.).
Scalability : Works well for large teams handling many concurrent tasks.
In summary, conventional branches improve project organization, communication, and automation within Git workflows.
FAQ
What tools can automatically enforce this convention if team members do not follow it?
You can use commit-check to validate branch names, or, if your repository is hosted on GitHub, use commit-check-action .
Thank you for your attention! Feel free to like, share, comment, or leave a message.
References
[1]
commit-check: https://github.com/commit-check/commit-check
[2]
commit-check-action: https://github.com/commit-check/commit-check-action
DevOps Engineer
DevOps engineer, Pythonista and FOSS contributor. Created cpp-linter, commit-check, etc.; contributed to PyPA.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.