Managing Multiple Documentation Versions with Read the Docs
Learn how Read the Docs automatically builds versioned documentation for every Git tag, letting readers switch releases via a dropdown, and see a practical setup with a sample .readthedocs.yaml and verification steps.
17 Jun 2026, 07:57 UTC

When a library ships frequent releases, users often land on documentation that belongs to an older version, leading to confusion and broken links. Maintaining a separate copy of the docs for each release multiplies effort and makes it hard to keep everything in sync. Read the Docs (RTD) solves this by automatically building and serving a distinct version of the documentation for every Git tag or branch, exposing a version picker so readers can jump to the exact release they need.
Why versioned documentation matters
Without versioning, a single "latest" docs page must serve all audiences. Users of v1.2 may see API changes that only appear in v2.0, while newcomers miss out on stable guides tied to a specific release. RTD’s built‑in versioning eliminates this mismatch by:
- Watching the connected VCS (GitHub, GitLab, Bitbucket) for new tags or branches.
- Triggering a fresh documentation build for each detected ref.
- Storing the build under a URL path like
/<version>/. - Providing a dropdown selector in the site header that lets visitors switch between
latest,stable, and any named version.
Setting up versioning in Read the Docs
First, ensure you have administrative access to the RTD project and push rights to the source repository. Then add a minimal configuration file that tells RTD how to treat your main branch and any tags you want to expose as readable versions.
Add .readthedocs.yaml
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
# Treat the default branch as the "stable" version
versions:
stable: main
# Optional: map tags to friendly names
aliases:
# Example: a tag v1.2.3 appears as "1.2" in the picker
"1.2": v1.2.3
Place this file at the repository root, commit, and push to the default branch (usually main). RTD will detect the file on the next build and apply the version settings.
Worked example: publishing a new release
Suppose you maintain a Python library and just tagged release v2.1.0. Follow these steps to make the version appear in RTD:
- Create the tag locally (requires write access to the repo):
git tag v2.1.0 git push origin v2.1.0 - Wait for RTD to notice the new tag. RTD polls the VCS; a build should start within a few minutes. You can monitor progress on the project’s Builds page.
- Verify the build succeeded. Click the build log for the
v2.1.0version and look for a successful exit status. - Check the version picker. Visit your RTD site (e.g.,
https://myproject.readthedocs.io) and open the dropdown in the header. You should see entries likelatest,stable, and2.1(the alias you defined). Selecting2.1loads the documentation built from thev2.1.0tag. - Confirm content isolation. Navigate to a page that changed between
v2.0andv2.1(e.g., an updated API reference). The text should match the source in thev2.1.0tag, not themainbranch.
Trade‑offs and practical checks
Each additional version consumes build minutes and storage. On the free RTD plan, excessive active branches can lengthen queue times; on commercial plans, it raises cost. To keep overhead low:
- Avoid long‑lived feature branches that merely duplicate work; delete them once merged.
- Use tags only for official releases; treat branches as temporary.
- Periodically prune old versions from the Admin → Versions page if they are no longer needed.
You can verify that versioning is working correctly by:
- Opening Project Admin → Versions and confirming the new tag appears with a
Builtstatus. - Visiting the live site and using the version dropdown to load each version; the URL should change to
/<version>/. - Reviewing the build logs for each version to ensure a separate build was triggered.
Actionable closing
Start small: add the .readthedocs.yaml file, push a single release tag, and watch the version picker appear. Once you confirm the isolation works, adopt the same process for every future release. This gives your users a reliable way to access the exact documentation that matches the code they are using, while keeping your documentation source in a single repository.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.