> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doglytdc.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Branches and versions

> How code becomes a version: branches, Stable and Beta channels, and how to roll back.

## Branches

Every script has a repository with a main branch. Each write (`write_files` or `POST /scripts/{script_id}/repo/commits`) becomes a commit and needs the branch's current `expected_head`. That way two AIs never erase each other's work: if the branch moved, the write is refused and you must read again.

| Action | MCP tool |
| - | - |
| See branches and the `head_sha` | `list_branches` |
| Create from a commit (default: head of main) | `create_branch` |
| See what would change and whether there is a conflict | `compare_branches` |
| Merge (stops on conflict) | `merge_branch` |

## Versions

Publishing bundles the `src/` folder, minifies it, protects it and creates a version. Each channel has a single **live** version, the one users receive.

| Channel | `channel` | Comes from |
| - | - | - |
| Stable | `stable` | Only the main branch. Merge before publishing. |
| Beta | `beta` | A branch other than main. |

> [!WARNING]
>
> Publishing without protection requires confirmation (`confirm_unprotected`). The code stays readable to whoever installs it.

To go back, use `rollback_release` with the previous version: the channel starts delivering that version. Nothing is deleted.

Tools: [Versions](https://docs.doglytdc.dev/en/scripts/mcp/tools/versions.md) · [Branches](https://docs.doglytdc.dev/en/scripts/mcp/tools/branches.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.