You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: editor/branches.mdx
+20-36Lines changed: 20 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,50 +3,34 @@ title: "Working with branches"
3
3
description: "Use branches to make and review changes without affecting your live documentation"
4
4
---
5
5
6
+
Branches are a feature of version control that point to specific commits in your repository. Your deployment branch, usually called `main`, represents the content that is used to build your live documentation. All other branches are independent of your live docs unless you choose to merge them into your deployment branhc.
7
+
6
8
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 at the same time without affecting what users see on your live site until you publish any changes.
7
9
8
10
We recommend always working from branches when updating documentation to keep your live site stable and enable review workflows.
9
11
10
-
## Creating a branch
11
-
12
-
<Steps>
13
-
<Steptitle="Open the branch selector">
14
-
Select the branch name in the editor toolbar (usually `main`).
15
-
</Step>
16
-
<Steptitle="Create new branch">
17
-
Select **New Branch** from the dropdown menu.
18
-
</Step>
19
-
<Steptitle="Name your branch">
20
-
Use a descriptive name that explains what you're working on:
21
-
- `update-getting-started`
22
-
- `fix-api-examples`
23
-
- `restructure-navigation`
24
-
</Step>
25
-
<Steptitle="Create and switch">
26
-
Select **Create Branch**. The editor switches to your new branch automatically.
27
-
</Step>
28
-
</Steps>
29
-
30
-
<Note>
31
-
If the editor doesn't switch automatically, select your new branch from the dropdown menu.
32
-
</Note>
33
-
34
-
## Saving and switching
35
-
36
-
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.
37
-
38
-
To switch branches, select the current branch name in the toolbar and choose a different branch from the dropdown.
39
-
40
12
<Tip>
41
-
Unsaved changes are lost when switching branches. Save your work first.
13
+
- Name branches clearly so teammates understand what you're working on.
14
+
- Delete branches after merging to keep your repository organized.
15
+
- Let your team know when you're working on major changes that might affect their work.
42
16
</Tip>
43
17
44
-
## Understanding branch types
18
+
## Creating a branch
45
19
46
-
**Deployment branch**: Your main branch (usually `main`) contains your live documentation. Changes here publish immediately to your site.
20
+
1. Select the branch name in the editor toolbar (usually `main` by default).
21
+
2. Select **New Branch**.
22
+
3. Enter a descriptive name for your branch like `update-getting-started` or `fix-api-examples`.
23
+
4. Select **Create Branch**.
47
24
48
-
**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.
25
+
## Saving changes on a branch
49
26
50
-
## Working with your team
27
+
To save your changes on a branch, select the **Save Changes** button in the top-right corner of the editor. This creates a commit and pushes your work to your branch.
51
28
52
-
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.
29
+
## Switching branches
30
+
31
+
1. Select the branch name in the editor toolbar.
32
+
2. Select the branch you want to switch to from the dropdown menu.
33
+
34
+
<Tip>
35
+
Unsaved changes are lost when switching branches. Make sure to save or publish your work before switching branches.
0 commit comments