Skip to main content

Make changes on branches

Branches allow you to iterate and experiment with your Stainless config and OpenAPI spec in the Studio before merging to the Stainless main branch.

If a project has the branches feature enabled, each user will have a dev branch and can edit the project’s OpenAPI spec and Stainless config on the branch in the Studio. As you edit a branch, you’ll see the resultant changes in the SDK docs preview.

Once you initiate a build on a branch, your changes will be saved to a matching branch in your project’s config repo, and then a generated SDK will be written to a matching branch in each language’s corresponding staging repo. If the generated SDK looks good, you can merge your branch into main through the Studio.

When you merge your branch, you’ll be asked to provide a commit message to use in your SDK repo commit message and changelog. Use the conventional commits format.

We will attempt to keep your dev branch up-to-date with main by rebasing each time you visit the Studio, but occasionally there will be a merge conflict. In this case we will link to a merge conflict PR from the Studio, and you can either resolve the conflict through the GitHub UI or hard reset your branch to main through the Studio.

Custom code is currently only supported on the main branch. If you add custom code to a dev branch on an SDK, it will be overwritten next time the branch is built.