Regulations using GitHub
Branch Naming Conventions
Basics
- Descriptive Names: A well-named branch gives immediate context for its purpose. Instead of generic names, choose clarity. For example:
feature/login,bugfix/navbar-overflow - Use Hyphens: Use hyphens to seperate words (or kebab case) in branch name, this ensures readability. For instance,
bugfix/fix-login-issueis more readable thanbugfix/fixLoginIssueorbugfix/fix_login_issue. - Alphanumeric Lowercase Characters: Use only alphanumeric lowercase characters (a-z, 0–9) and hyphens. Avoid punctuation, spaces, underscores, or any special characters whenever possible.
- Avoid Unneccessary Hyphens: Avoid unneccessary hyphens, like subsequent or trailing hyphens. For instance,
feat/new — login-is a bad practice. - Short and Effective: Keep branch names simple. While descriptive, they should also be concise enough to convey the goal at a glance.
Prefix or Type
- Prefixing branches helps to organize them according to their purpose. This not only improves clarity, but also helps to automate workflows.
- Some of the common branch type prefixes and their usage cases include:
- feature/: For developing new features,
- bugfix/: To fix bugs in the code. Often created associated to an issue.
- hotfix/: To fix critical bugs in the production.
- release/: To prepare a new release, typically used to do tasks such as last touches and revisions.
- docs/: Used to write, modify or correct documentation.
For example,feature/new-feature or release/version-1.0.0.
Including Ticket Numbers
If your project employs an issue tracking system such as Jira, or if it revises based on github issues or another comparable tool. Including the token for the issue in the branch name would make it simple to track. Example: feature/PROJ-123-footer-links
Commit Message Conventions
Here is a template to use as guideline for commit messages:
[<optional state> #issueid] (50 chars or less) summary of changes
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so.
Further paragraphs come after blank lines.
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, preceded by a
single space, with blank lines in between, but conventions vary here
Read more: