PUT /repositories/{workspace}/{repo_slug}/branching-model/settings

Update the branching model configuration for a repository.

The development branch can be configured to a specific branch or to track the main branch. When set to a specific branch it must currently exist. Only the passed properties will be updated. The properties not passed will be left unchanged. A request without a development property will leave the development branch unchanged.

It is possible for the development branch to be invalid. This happens when it points at a specific branch that has been deleted. This is indicated in the is_valid field for the branch. It is not possible to update the settings for development if that would leave the branch in an invalid state. Such a request will be rejected.

The production branch can be a specific branch, the main branch or disabled. When set to a specific branch it must currently exist. The enabled property can be used to enable (true) or disable (false) it. Only the passed properties will be updated. The properties not passed will be left unchanged. A request without a production property will leave the production branch unchanged.

It is possible for the production branch to be invalid. This happens when it points at a specific branch that has been deleted. This is indicated in the is_valid field for the branch. A request that would leave production enabled and invalid will be rejected. It is possible to update production and make it invalid if it would also be left disabled.

The branch_types property contains the branch types to be updated. Only the branch types passed will be updated. All updates will be rejected if it would leave the branching model in an invalid state. For branch types this means that:

  1. The prefixes for all enabled branch types are valid. For example, it is not possible to use '*' inside a Git prefix.
  2. A prefix of an enabled branch type must not be a prefix of another enabled branch type. This is to ensure that a branch can be easily classified by its prefix unambiguously.

It is possible to store an invalid prefix if that branch type would be left disabled. Only the passed properties will be updated. The properties not passed will be left unchanged. Each branch type must have a kind property to identify it.

There is currently a side effect when using this API endpoint. If the repository is inheriting branching model settings from its project, updating the branching model for this repository will disable the project setting inheritance.

We have deprecated this side effect and will remove it on 1 August 2022.

Servers

Path parameters

Name Type Required Description
repo_slug String Yes

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace String Yes

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.