main, represents the content used to build your live documentation site. All other branches are independent of your live docs unless you choose to merge them into your deployment branch.
Branches let you create separate instances of your documentation to make changes, get reviews, and try new approaches before publishing. Your team can work on branches to update different parts of your documentation simultaneously without affecting what users see on your live site.
The following diagram shows an example of a branch workflow where a feature branch is created, changes are made, and then the feature branch is merged into the main branch.
We recommend always working from branches when updating documentation to keep your live site stable and enable review workflows.
Branch naming conventions
Use clear, descriptive names that explain the purpose of a branch. Use:fix-broken-linksadd-webhooks-guidereorganize-getting-startedticket-123-oauth-guide
tempmy-branchupdatesbranch1
Create a branch
- Using web editor
- Using local development
- Click the branch name in the editor toolbar.
- Click New Branch.
- Enter a descriptive name.
- Click Create Branch.
Save changes on a branch
- Using web editor
- Using local development
Select the Save as commit button in the top-right of the editor toolbar. This creates a commit and pushes your work to your branch automatically.
Switch branches
- Using web editor
- Using local development
- Select the branch name in the editor toolbar.
- Select the branch you want to switch to from the dropdown menu.
Merge branches
Once your changes are ready to publish, create a pull request to merge your branch into the deployment branch.Delete a branch
After merging a branch, you can delete it to keep your repository organized.- Using web editor
- Using local development
After your pull request is merged, the web editor displays a notification that the branch has been merged. Click Delete branch to remove the branch from your repository.
You cannot delete the deploy branch or the repository’s default branch (usually
main).