|  | 
| 1 | 1 | --- | 
| 2 | 2 | title: "Working with branches" | 
| 3 |  | -description: "Use branches to safely make changes without affecting your live documentation" | 
|  | 3 | +description: "Use branches to make and review changes without affecting your live documentation" | 
| 4 | 4 | --- | 
| 5 | 5 | 
 | 
| 6 |  | -Branches let you work on changes without affecting your live documentation site. When your changes are ready, you can merge them into your deployment branch through a pull request. | 
|  | 6 | +Branches are a version control feature that let you create separate instances of your documentation, then merge into your main branch if you want to publish your changes. Think of a branch as a copy of your documentation where you can experiment, make edits, and test changes before they go live. | 
| 7 | 7 | 
 | 
| 8 |  | -## Why use branches | 
|  | 8 | +A benefit of branches is that your team can work simultaneously on seprate branches without getting in each other's way. Even if two different branches make changes to the same file, you will be required to resolve any conflicts before merging branches and publishing your docs updates. | 
| 9 | 9 | 
 | 
| 10 |  | -**Best practice: Always work from branches.** This approach: | 
|  | 10 | +If you decide that you don't want to publish changes from a branch, you can delete the branch with no consequences. This makes branch a safe place to experiment and try new approaches to your content. | 
| 11 | 11 | 
 | 
| 12 |  | -- Keeps your live documentation stable while you make changes | 
| 13 |  | -- Enables proper review workflows with your team | 
| 14 |  | -- Creates a clear history of what changed and when | 
| 15 |  | -- Allows you to experiment safely with new content or structure | 
| 16 |  | - | 
| 17 |  | -Even if you're working solo, branches are valuable for previewing changes before they go live. | 
|  | 12 | +We recommend that you always work from branches when you're updating your documentation. This ensures that your live site stays stable and enables review workflows for any updates. | 
| 18 | 13 | 
 | 
| 19 | 14 | ## Creating a branch | 
| 20 | 15 | 
 | 
| 21 | 16 | <Steps> | 
| 22 | 17 |   <Step title="Open the branch selector"> | 
| 23 |  | -    Select the branch name in the editor toolbar (usually `main` by default). | 
|  | 18 | +    Select the branch name in the editor toolbar (usually `main`). | 
| 24 | 19 |   </Step> | 
| 25 | 20 |   <Step title="Create new branch"> | 
| 26 | 21 |     Select **New Branch** from the dropdown menu. | 
| 27 | 22 |   </Step> | 
| 28 | 23 |   <Step title="Name your branch"> | 
| 29 |  | -    Enter a descriptive name like: | 
|  | 24 | +    Use a descriptive name that explains what you're working on: | 
| 30 | 25 |     - `update-getting-started` | 
| 31 |  | -    - `fix-installation-steps`   | 
| 32 |  | -    - `add-api-examples` | 
|  | 26 | +    - `fix-api-examples`   | 
|  | 27 | +    - `restructure-navigation` | 
| 33 | 28 |   </Step> | 
| 34 | 29 |   <Step title="Create and switch"> | 
| 35 |  | -    Select **Create Branch**. The editor will switch to your new branch automatically. | 
|  | 30 | +    Select **Create Branch**. The editor switches to your new branch automatically. | 
| 36 | 31 |   </Step> | 
| 37 | 32 | </Steps> | 
| 38 | 33 | 
 | 
| 39 | 34 | <Note> | 
| 40 |  | -  If the editor doesn't automatically switch to your new branch, select it manually from the branch dropdown. | 
|  | 35 | +  If the editor doesn't switch automatically, select your new branch from the dropdown menu. | 
| 41 | 36 | </Note> | 
| 42 | 37 | 
 | 
| 43 |  | -## Saving changes on a branch | 
| 44 |  | - | 
| 45 |  | -When you're working on a branch: | 
| 46 |  | - | 
| 47 |  | -1. Make your edits in visual mode or Markdown mode | 
| 48 |  | -2. Select the **Save Changes** button in the top-right corner | 
| 49 |  | -3. This creates a commit with your changes and pushes it to your branch | 
|  | 38 | +## Saving and switching | 
| 50 | 39 | 
 | 
| 51 |  | -Your changes are now saved but not yet live on your documentation site. | 
|  | 40 | +Save changes to your branch by selecting **Save Changes** in the top-right corner. This creates a commit and pushes your work to the branch. | 
| 52 | 41 | 
 | 
| 53 |  | -## Switching between branches | 
| 54 |  | - | 
| 55 |  | -<Steps> | 
| 56 |  | -  <Step title="Open branch selector"> | 
| 57 |  | -    Select the current branch name in the editor toolbar. | 
| 58 |  | -  </Step> | 
| 59 |  | -  <Step title="Choose target branch"> | 
| 60 |  | -    Select the branch you want to switch to from the dropdown menu. | 
| 61 |  | -  </Step> | 
| 62 |  | -</Steps> | 
|  | 42 | +To switch branches, select the current branch name in the toolbar and choose a different branch from the dropdown. | 
| 63 | 43 | 
 | 
| 64 | 44 | <Tip> | 
| 65 |  | -  Any unsaved changes will be lost when switching branches. Make sure to save your work first by selecting **Save Changes**. | 
|  | 45 | +  Unsaved changes are lost when switching branches. Save your work first. | 
| 66 | 46 | </Tip> | 
| 67 | 47 | 
 | 
| 68 |  | -## Branch types | 
| 69 |  | - | 
| 70 |  | -### Deployment branch | 
| 71 |  | -Your main branch (often called `main`) contains your live documentation content. Changes to this branch are automatically published to your documentation site immediately. | 
|  | 48 | +## Understanding branch types | 
| 72 | 49 | 
 | 
| 73 |  | -### Feature branches | 
| 74 |  | -Any branch other than your deployment branch. Use these for: | 
| 75 |  | -- New feature documentation | 
| 76 |  | -- Content updates and revisions   | 
| 77 |  | -- Experimental changes | 
| 78 |  | -- Collaborative work that needs review | 
|  | 50 | +**Deployment branch**: Your main branch (usually `main`) contains your live documentation. Changes here publish immediately to your site. | 
| 79 | 51 | 
 | 
| 80 |  | -Changes on feature branches require a pull request to merge into your deployment branch. | 
|  | 52 | +**Feature branches**: All other branches where you work on changes before they're ready to go live. These require a pull request to merge into your main branch. | 
| 81 | 53 | 
 | 
| 82 |  | -## Best practices | 
|  | 54 | +## Working with your team | 
| 83 | 55 | 
 | 
| 84 |  | -- **Use descriptive branch names** that explain what you're working on | 
| 85 |  | -- **Keep branches focused** on a single task or feature | 
| 86 |  | -- **Save frequently** to avoid losing work when switching branches | 
| 87 |  | -- **Delete branches** after merging to keep your repository clean | 
| 88 |  | -- **Communicate with your team** about which branches are active | 
|  | 56 | +Name branches clearly so teammates understand what you're working on. Delete branches after merging to keep your repository organized. Let your team know when you're working on major changes that might affect their work. | 
0 commit comments