Branches and versions
One version per branch
Each configured branch of the repository is its own version of the project. main is served at the project’s root; another branch, say feature/new-intro, is served under _b/feature-new-intro/. Use a branch to put a draft up for review next to the published text.
Comments stay in their version. They are never carried over when the branch is merged, so finish the discussion where it started.
Add a branch
- An owner opens Settings → Versions, enters the git branch name, and chooses Add branch.
- Add the branch to the workflow’s
on: push: branches. The workflow file on the project page already lists every version. - Push to the branch. Builds for branches that aren’t versions are refused.
Switch and finish
- Owners and editors switch with Version in the yellow bar of a document; readers see the version their link points at.
- Each push makes a new build. A version always shows its latest build, and comments find their passage again: if it changed, you see “Text changed since this comment”; if it is gone, “Text no longer in the document”.
- When a branch is done, an owner chooses Archive in Versions. Its comments stay readable but can’t change, and its URL name is never reused.