Branches

An API version can have one or more branches. Apart from the default branch, which is mandatory, you can have other active branches associated with the version.

Set default branch

The default branch is set when you connect your source.

  • For a Git-based source, the default branch is your Git branch name.
  • If you use the file upload source, you will be asked to select a branch name.
  • If you use the URL source, you are assigned a default branch name, as this source does not support branches.
  • If you use the CICD source, you can provide a default branch name, otherwise, a default branch name will be assigned.

branch

From the Branches page, you can:

  • View the default and other active branches
  • Change the default branch for the selected version
  • Delete other active branches associated with the version

View default branch

To view the default branch, from the API registry page, select your version, and navigate to Settings > Branches.

Change default branch

You can change the default branch to any other active branch.

Change to other active branch

To change default branch to another active branch, navigate to the version's Settings > Branches screen and for the branch you want to set as the default branch, select Set branch as default.

Set branch as default

If you want to change to another non-active branch, you will need to edit the source.

Change to non-active branch

To change the default branch to a non-active branch, edit the source from the Settings > Version source page.

version source

Other active branches

The branches that display in other active branches depend on your source settings.

build settings

  • If you select "Validate and bundle from other branches", any subsequent push to a branch will trigger it to be added to the other active branches.
  • If you select "Validate and bundle from PRs", any subsequent pull request (PR) will trigger it to be added to the other active branches.

Delete other active branches

info

If you delete a branch in your connected source (for example, GitHub), it will also be deleted from the other active branches. However, if you delete a branch from the Branches page, it is not automatically deleted from your connected source.

To delete any other active branch, navigate to the version's Settings > Branches screen and for the branch you want to delete, select the Delete icon.

delete other active branch