What branch name conventions do you use?

David Pinn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 2, 2012

What, if any, conventions do you apply to the naming of branches in order to create notional groups of branches? I'm trying to validate a hypothesis to help shape a plugin idea.

This is a question for users of Stash; but StashDev might as well chip in, although I already have some idea of how you work. :-)

Do you, for example, name branches to reflect the release you intend them to be part of? Do you name them according to the software component or feature they apply to? Something else?

8 answers

1 accepted

10 votes
Answer accepted
jhinch (Atlassian)
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 4, 2012

Hi David,

I find that there are 2 main naming convention styles within git. Hyphen separated or slash separated. GitFlow uses the latter to separate groups of branches:

e.g.

hotfixes/ANERD-9999
releases/2.1
features/totality-search

Many of the cross product teams within Atlassian use this convention. Product teams within Atlassian seem to use the hyphen approach:

e.g.

release-4.5.x
ANERD-3333-project-visualisation
1.3-ANERD-2020-ie8-fixes

I find a lot of Git experts like to use the slashes approach as it equates to directories organising branches on the filesystem

17 votes
Stephen2Aus October 26, 2017

Git flow standards:

 

 - master

 - develop

 - feature/XXX (encourage JIRA issue key)

 - release/XXX (encourage JIRA issue key if applicable, e.g., a Deploy ticket, or a single feature)

 - hotfix/XXX (encourage JIRA issue key)

6 votes
Stefan Saasen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 4, 2012

I know that the Confluence team has adopted the following approach and follows an "Issue/Story driven development" workflow:

Short lived branches are created for every issue/story using the following naming convention:

issue/JIRA-ISSUE-KEY

or

issue/JIRA-ISSUE-KEY-short-summary

Hth,

Stefan

1 vote
Os,man May 25, 2021

Branch names CAN have following format:


Branches are of the following types and naming should be chosen based on its type accordingly and use “-” and “_” with lower and uppercase alphanumeric characters as applicable, While creating branch make sure your select from only first four options, the type “Others” are reserved to be used only in exceptional cases like (R&D, Practice, Temp Changeset Folders etc)


Branch Types:


i. Release
REL_<RELEASE-DATE(YY-MM-DD)>_CHN-<CHANGE-NUMBER>
Example:
REL_21-06-25_CHN-123


ii. Feature/Bugfix/Hotfix
<JIRA-FS-ID>_<RELEASE-DATE(YY-MM-DD)>_CHN-<CHANGE-NUMBER>
<JIRA-FS-ID>_<short-description>
Example:
NPI-777_21-06-25_CHN-456
INC-6283_21-06-25_CHN-789
NPI-777_adding-coterm-date
INC-6283_fixing-visibility-rules


iii. Others
<TEAM_OR_REASON-CODE>_<short-description>
Example:
ADS_angular-upgrade-test

1 vote
Deleted user October 26, 2017

We have a centralized/non-forking workflow.

We encourage developers to push their in-work features to the centralized repo. We enforce feature branches pushed to the server follow the standard of: <username>/<branchname>. We recommend the branch be named as the issue ID, but that is not part of our process.

We do not differentiate between hotfix, bugfix or feature.

We do not use master past the first commit. It makes the initial clone faster.

Releases each have their own short uniquely named branch without a slash. We try to keep these names to 6 characters or less.

0 votes
Naved Maulavi June 12, 2018

All the standards mentioned in above answers are all time best standards to follow for branching in GIT. We always prefer the creation of branch name includes some sprint name and JIRA no. 

We use the following conventions for creating branches while working with Agile JIRA sprint mode.

i.e. 

  • Sprint Master Branch - <PROJECT_SHORT_NAME><SPRINT_NO.> - e.g. MCS40
  • Sprint Dev Branch - <PROJECT_SHORT_NAME><SPRINT_NO.>_<JIRA_NO> - e.g. MCS40_MM-7387
  • Sprint Release Branch - Release_<PROJECT_SHORT_NAME><SPRINT_NO.>_<SUB_PROJECT_SHORT_NAME>_<VERSION_OF_RELEASE> - e.g. Release_MCS40_MM_1.2.5
  • Hotfix Branch - e.g. Hotfix_MCS40_MM-7400

 

I hope it will help someone.

Thanks.




0 votes
Deleted user October 27, 2017

We work on a mercurial repo, branch-per-version, branch-per-issue and development on default.

Versions are semver, vMajor.minor.patch.
Issue branches are Jira codes.

0 votes
Geoff Bourne February 7, 2013

For our development/code review/pull request branches we are using a scheme of

DEV-(username)-(Jira issue key)-(optional desc/keyword)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events