Configuring the branching model
Stash uses a 'branching model' to define the branch workflow for each repository. As a project administrator, configuring the model lets you:
- enable the branch types that will be available in your workflow.
- specify the naming convention to be used for each branch type.
The naming convention simply adds prefixes to branch names, so that branches of the same type get the same prefix.
To configure the branching model for a repository, go to Settings > Branching model for the repository and click Enable branching model.
Stash makes a number of branch types available, as described below. Use the checkboxes to enable just those branch types that map to your workflow. Note that several branch types have default branch naming prefixes (for example the default prefix for the 'feature' branch type is /feature), as shown:
Creating branches
You can create a new branch when in JIRA, or in Stash. Either way, you can override the settings that Stash suggests for the repository, branch type, branching point and branch name.
From a JIRA issue
JIRA must be connected with Stash by an application link for this functionality to be available.
When viewing an issue in JIRA, click Create Branch (under 'Development' – you'll need the 'View Development Tools' project permission in JIRA to see this):

Choose the SCM, if more than one is available, where you want to create the branch:

Stash suggests the branch type and branch name, based on the JIRA issue type and summary. You can change these if necessary:

From in Stash
In Stash, choose Create branch from the Actions menu when viewing the Files, Commits or Branches tabs, or when viewing a particular branch. Change the settings suggested by Stash, if necessary:

Creating the branch
You can specify:
- the Repository
- the Branch type, if a branching model has been previously configured – choose Custom if you need an ad hoc branch type
- the branch point
- the Branch name – the prefix is based on the branch type you selected, and as defined by the branching model. Note that the branch name should follow your team's convention for this.
Once it's created, Stash takes you to the file listing for the new branch. You can now pull to your local repository and switch to the new branch.
Managing all your branches
The Branches tab in Stash provides an overview of all the branches in the repository that you have permissions to view:

The Behind/Ahead column shows by how many commits a branch has diverged from the default branch (for example, master) for the repository, which can help you to identify work in progress as well as stale branches.
Use the Actions menu to manage a particular branch in the repository:

When viewing a particular branch, the Action menu provides options relevant to just that branch:








