List Branches
Returns a list of all open branches within the specified repository. Results will be in the order the source control manager returns them. Branches support filtering and sorting that can be used to search for specific branches.
By default, results will be in the order the underlying source control system returns them and identical to the ordering one sees when running ”$ git branch —list”. Note that this follows simple lexical ordering of the ref names.
This can be undesirable as it does apply any natural sorting semantics, meaning for instance that tags are sorted [“v10”, “v11”, “v9”] instead of [“v9”, “v10”, “v11”].
Sorting can be changed using the ?q= query parameter. When using ?q=name to explicitly sort on ref name, Bitbucket will apply natural sorting and interpret numerical values as numbers instead of strings.
External Documentation
To learn more, visit the Bitbucket documentation.
Parameters
Parameter | Description |
---|---|
Query String | Query string to narrow down the response as per filtering and sorting. |
Repo Slug | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID} . |
Sort | Field by which the results should be sorted as per filtering and sorting. The name field is handled specially for branches in that, if specified as the sort field, it uses a natural sort order instead of the default lexicographical sort order. For example, it will return [‘branch1’, ‘branch2’, ‘branch10’] instead of [‘branch1’, ‘branch10’, ‘branch2’]. |
Workspace Slug | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID} . |
Example Output
Workflow Library Example
List Branches with Bitbucket and Send Results Via Email
Preview this Workflow on desktop