Skip to main content

Branch, promote, and roll back in the UI

This guide stages a change to one prompt on a dev branch, compares it with main, promotes it, merges it, and rolls main back. In Priompt, branches belong to a single prompt, and main is the branch served to agents. To do the same from code or the CLI, see Branch, pin, and roll back a prompt.

Prerequisites​

Before you begin, make sure you have:

  • The web UI running and connected to a server: see Run the web UI.
  • An rw token for the prompt's org in the UI's configuration, if the server has authentication on.
  • A prompt with a few commits, for example priompt://acme/onboarding/welcome.

1. Pick the prompt​

To open a prompt's branches:

  1. Open the namespace, for example acme.

  2. Select the Branches tab.

  3. Under Prompt, select the prompt, for example onboarding/welcome.prompt.

    The page lists the prompt's branches, with Promote and Rollback sections below them.

2. Create a branch​

  1. Select New branch.

  2. In Branch name, enter dev.

  3. In Source branch, keep main.

  4. Select Create branch.

    Create new branch dialog with Branch name dev and Source branch main.

    The new branch starts at the source branch's latest commit.

    A banner confirms Created dev from main., and dev appears in the branch list.

3. Commit a change to dev​

Edits on dev don't change what agents get from main.

To commit to dev:

  1. Open the prompt, and pick dev in the branch switcher next to the file name.

  2. Select Edit, change the template, and select Save.

  3. Enter a commit message. Commit to: shows dev, and lists the prompt's other branches too.

  4. Select Commit changes.

    The Branches tab now shows your message as the latest commit on dev.

    Branches view for onboarding/welcome.prompt with main (default, serving) and the new dev branch highlighted, with its Compare and Merge into main buttons.

    Each branch shows its latest commit message and author.

4. Compare dev with main​

  1. In the branch list, select Compare on the dev row. The prompt page offers the same Compare button when it shows a branch other than main.

    The page opens at /<org>/compare/main...dev?path=<prompt path>, for example /acme/compare/main...dev?path=onboarding/welcome.prompt.

    Compare changes for main and dev: 1 commit ahead, an inserted line 4, and the semantic propagation diff verdict localized tweak.

    dev is one commit ahead of main and adds line 4, a localized tweak.

Use base and compare to pick other branches. The verdict reads the same way as on a commit. See Review a commit and its verdict.

5. Promote dev to staging​

Promoting moves a prompt from one environment branch to the next, for example dev to staging to prod. Priompt records each promotion as a commit.

  1. Under Promote, set From to dev and To to staging.

  2. Select Promote.

    Branches view after promoting: a green banner &quot;Promoted dev to staging&quot;, the new staging branch highlighted, and the Promote form set to dev and staging.

    staging now holds the change from dev.

If the target branch doesn't exist yet, the UI creates it from the source branch first.

6. Merge dev into main​

  1. In the branch list, select Merge into main on the dev row.

    Branches view after merging: a green banner &quot;Merged dev into main&quot;, and main highlighted with the latest commit &quot;merge dev into main&quot;.

    main has a new commit, and agents are now served the change.

7. Roll back main​

Rolling back points main at an earlier commit. Nothing is deleted, and agents get the earlier version at once.

  1. Under Rollback, find the commit you want main to serve.

  2. Select Roll back to here on that row.

    Rollback list after a rollback: commit 06100c3 marked current, Roll forward to here on the three newer commits (the merge, the promotion to staging, and the change from dev), and Roll back to here on the three older commits.

    main points at 06100c3 again, the commit before the change from dev. The newer commits, including the merge commit, can still be rolled forward to.

    A banner confirms that main now points at the commit, with Undo: move main back to <commit> to return main to where it was.

The list shows the commits of main, dev, staging, and prod, newest first, and marks the one main serves as current. Newer commits offer Roll forward to here. A commit that no listed branch reaches, such as a merge commit you rolled back past, drops out of the list once you leave the page; use Undo right away, or roll forward from code. Listing every commit is tracked in priompt#45.

Next steps​