Git branch names should only consist of ticket numbers, lowercase
Introduction
Across all practices, it's important to maintain naming conventions for branches to make it easier for PMs, Architects, and devs to manage commits, comments, and JIRA tickets. Consistency will reduce time to find relevant code and to onboard new team members more quickly.
Decision
Branch names should be in the following format:
proj-123
Where proj
indicates the project abbreviation code in Jira
and the 123 corresponds to the Jira ticket number where the task was
requested.
Context
This is done for two main reasons:
- Branches can easily be traced back to their initial request via the ticket number.
- Branch names will meet the Pantheon MultiDev requirements of being lowercase and 11 characters or less.
Consequences
- Team members have a clear and consistent guide to naming branches.
- Specific code will be easier to find.
- Projects will have greater tracking fidelity between Jira and Git.
- Any branch can be turned into a Pantheon MultiDev environment.
- You can't create branches from Jira because it doesn't allow low-case names.
Exceptions
- You don’t have to follow the convention for big epics such as Drupal core major updates, etc.
- If you need a second PR with revisions on the same issue then add -n (where n is the number of the iteration). Only do this once your original PR is merged or closed. And update Jira ticket description to include the new branch name.