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.
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.
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
To view the default branch, from the API registry page, select your version, and navigate to Settings > Branches.
You can change the default branch to any 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.
If you want to change to another non-active branch, you will need to edit the source.
To change the default branch to a non-active branch, edit the source from the Settings > Version source page.
The branches that display in other active branches depend on your source 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.
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.