Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions guides/branches.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

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.

Check warning on line 11 in guides/branches.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/branches.mdx#L11

In general, use active voice instead of passive voice ('is created').

Check warning on line 11 in guides/branches.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/branches.mdx#L11

In general, use active voice instead of passive voice ('are made').

Check warning on line 11 in guides/branches.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/branches.mdx#L11

In general, use active voice instead of passive voice ('is merged').

```mermaid
gitGraph
Expand All @@ -26,7 +26,7 @@
commit id: "Live docs"
```

We recommend always working from branches when updating documentation to keep your live site stable and enable review workflows.

Check warning on line 29 in guides/branches.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/branches.mdx#L29

Try to avoid using first-person plural like 'We'.

## Branch naming conventions

Expand Down Expand Up @@ -123,3 +123,31 @@
## 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.

<Tabs>
<Tab title="Using web editor">
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.

Check warning on line 133 in guides/branches.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/branches.mdx#L133

In general, use active voice instead of passive voice ('is merged').

Check warning on line 133 in guides/branches.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

guides/branches.mdx#L133

In general, use active voice instead of passive voice ('been merged').

<Note>
You cannot delete the deploy branch or the repository's default branch (usually `main`).
</Note>
</Tab>

<Tab title="Using local development">
Delete a branch locally and remotely:

```bash
# Delete the local branch
git branch -d branch-name

# Delete the remote branch
git push origin --delete branch-name
```

Use `-D` instead of `-d` to force delete a branch that hasn't been merged.
</Tab>
</Tabs>