Branches and environments
Studio uses Git branches for content workflows. Each branch is a parallel copy of your site that you can edit, preview, and merge back to your production branch when it is ready to publish.
The branch model
Section titled “The branch model”Studio assumes a single-trunk workflow:
mainis the production branch by default — every Studio project treatsmainas production unless you change it.- Every other branch is a working branch created off
main. - Working branches are merged back into the production branch — typically via a pull request — to publish their changes.
Several Studio features rely on this model:
| Behaviour | What it does |
|---|---|
| Pending-changes count | Compares your active branch against the production branch and shows the number of unpublished changes in the toolbar. |
| Revert | Reverting an entry or file restores its contents from the production branch and writes the result to the active branch. |
| Latest-deployment widget | Reads the most recent workflow run from the production branch. |
| Review (PR) | When you create a pull request from Studio, the PR’s base is always the production branch. |
The default production branch is main. To use a different branch (for
example master or production), open Settings → General → Production
branch and pick the branch from your repository.
Branches screen
Section titled “Branches screen”Open Branches from the Studio nav rail. The screen has three sections:
| Section | Contents |
|---|---|
| Main branch | Your production branch with its preview URL. |
| Imported branches | Working branches that have been imported as preview environments. |
| Available branches | Branches that exist in your Git repository but have not yet been imported as environments. |
Creating a branch
Section titled “Creating a branch”Click New branch to open the create-branch dialog. The dialog asks for:
- A Branch name — letters, numbers, hyphens, underscores, dots and slashes are allowed.
- A From branch — fixed to the production branch.
- An Auto-create preview environment checkbox — ticked by default.
When you click Create branch, Studio creates the branch directly in your GitHub repository. If the auto-create checkbox is ticked, Studio also imports it as a preview environment in the same step, then switches you to the new branch.
Importing an existing Git branch
Section titled “Importing an existing Git branch”Branches in your repository that have not been imported into Studio appear under Available branches. Click Import next to a branch to start the import flow:
- Studio shows the Git branch (read-only) and a suggested Environment name. Adjust the environment name if needed — lowercase letters, numbers, and hyphens only.
- Click Import to create the preview environment, or Cancel to abandon the flow.
Importing a branch as an environment creates a child project for the branch and wires up its automated deployment. Each environment has its own preview URL.
Removing an environment
Section titled “Removing an environment”Click Remove next to an imported branch. Studio asks you to confirm, then deletes the environment — its preview URL, its content, and its deployment configuration — but leaves the underlying Git branch in place so you can re-import it later or merge it from outside Studio.
Switching branches
Section titled “Switching branches”Use the branch selector in the Studio top bar to switch between branches. All editing, previewing, and file browsing happens on the currently selected branch. Changes you save are committed to that branch in GitHub.
Next steps
Section titled “Next steps”- Review and publishing — pull requests, deployment tracking, and post-merge cleanup
- Deployments — workflow runs, logs, and manual deploys
- Settings — change the production branch
