You already know what a branch is conceptually — a separate workspace where you can make changes without affecting the live site. This lesson is about using branches in practice: when to create one, what to call it, and how to manage it through to completion.Documentation Index
Fetch the complete documentation index at: https://learn.mintlify.com/llms.txt
Use this file to discover all available pages before exploring further.
When to create a branch
The rule is simple: any time you start a new piece of work, create a new branch. That includes small changes. It’s tempting to edit a single typo directly on main, but that bypasses the review step and skips the preview deployment. Even minor changes benefit from going through a pull request — it takes an extra thirty seconds and gives you a preview link to verify the change looks right before it goes live. The web editor handles this automatically — when you publish from the editor, Mintlify creates a branch and opens a pull request on your behalf. If you’re working locally with the CLI, you create the branch yourself before you start editing.How to name a branch
Branch names should describe the work being done. A name likeupdate-authentication-guide tells your teammates what’s changing. A name like ethan-edits or updates tells them nothing useful.
A few conventions that work well for documentation:
- Use lowercase letters and hyphens:
add-quickstart-page, notAdd Quickstart Page - Be specific enough to distinguish from other work:
fix-api-reference-broken-linksrather than justfix-links - Keep it short enough to type without pain — two to five words is usually right
The branch lifecycle
Every branch follows the same lifecycle:Create the branch
Start from an up-to-date copy of main. If you’re working locally:This ensures your branch starts with the latest version of the live docs, which reduces the chance of conflicts later.
Make your changes and commit
Edit your files, then save your progress with a commit. Commit as you go — you don’t have to wait until everything is finished.Each commit is a checkpoint you can refer back to. A series of focused commits is easier to review than one large commit at the end.
Push and open a pull request
When you’re ready for review, push your branch to GitHub and open a pull request.GitHub will prompt you to open a PR. Mintlify automatically generates a preview deployment as soon as the PR is open.