Branches
A branch is a separate copy of your project that you can change without affecting the main one. Use a branch to try a new structure, let a co-author draft a chapter on their own, or keep a submitted version untouched while you keep writing. When the work is ready, you merge it back with a pull request.
How branches work
Section titled “How branches work”- Every project has a branch called
main. It is the default branch and can’t be renamed or deleted. - A new branch starts from the last saved version of the branch you create it from. Changes on that branch since its last version are not copied. Save a version first if you want them included.
- Each branch has its own live copy, its own history and its own compiled PDF. People on different branches don’t see each other’s typing.
- There is no limit on the number of branches.
Create a branch
Section titled “Create a branch”You can create a branch from three places.
From the project page:
- Open the project and click the Branches tab.
- Click New branch.
- Type a Name, for example
feature/new-introorreview-draft. - Under Fork from, choose the branch to start from.
- Click Create branch.
From the editor: click the branch name in the header, then click New branch… at the bottom of the menu.
From a version in the history: open the History tab, click a version, then click Start a branch from this version. See Version history.
Branch names
Section titled “Branch names”- Letters (in any language), digits,
-,_,.and/, up to 100 characters. - Names are not case-sensitive. You can’t have both
Draftanddraft.
Switch branches
Section titled “Switch branches”- In the editor, click the branch name in the header.
- Pick a branch from Switch branch, or type in Find a branch… to search. The default branch is marked default.
To open a branch from the project page, use the branch’s Open in editor action on the Branches tab.
The Branches tab
Section titled “The Branches tab”The Branches tab lists every branch with when it last changed and how far it is ahead of or behind main. A default badge marks main, and a protected badge shows when main is protected.
Open a branch’s actions menu (⋯) to:
| Action | What it does |
|---|---|
| Open in editor | Opens the branch in the editor. |
| View history | Opens the branch’s version history. |
| Compare with main | Shows what changed on the branch compared with main. |
| Open pull request | Proposes merging the branch. Shows Nothing to merge when there is nothing new. |
| Rename branch | Gives the branch a new name. |
| Delete branch | Deletes the branch. |
Compare a branch with main
Section titled “Compare a branch with main”- On the Branches tab, open a branch’s actions menu and click Compare with main.
- Choose how to see the changes:
- Code diff shows the changed lines in each file.
- PDF shows the compiled document Before and After side by side. Use Previous change and Next change to step through the differences.
The page also shows how many versions the branch is ahead of and behind main. A branch is always compared with main. You can’t compare two other branches with each other.
The comparison uses saved versions only, so save a version on the branch to include your latest changes.
Rename a branch
Section titled “Rename a branch”- On the Branches tab, open the branch’s actions menu and click Rename branch.
- Type the New name and click Rename.
Delete a branch
Section titled “Delete a branch”- On the Branches tab, open the branch’s actions menu and click Delete branch.
- Click Delete branch to confirm.
Who can do what
Section titled “Who can do what”| Action | Owner | Editor | Viewer |
|---|---|---|---|
| See branches and compare them | Yes | Yes | Yes |
| Create a branch | Yes | Yes | No |
| Rename a branch | Yes | Yes | No |
| Delete a branch | Yes | No | No |
On an archived project, branches are read-only for everyone. See Roles and permissions.