Branches and commits

Understand how an agent keeps its history in branches and commits, and how that lets your team change the agent without changing what customers get.

UPDATED NOVEMBER 23, 20263 MIN READINCLUDES VIDEO

Every agent keeps its history the way a Git repository does. A branch is a line of work on the agent. Each time you push changes from the Agent Builder or the CLI, a new commit is added to the branch you are on, tagged with the next number in order. Exactly one commit is live: customers get exactly that commit until someone makes another one live.

Branches, commits and going live (40 seconds)
Transcript

Every agent has branches, and each push adds a commit. The branch pill in the top bar shows which one you are on. Click it to open the Branches window. You see each branch, its commits, and which commit is live. Compare takes two commits, and the builder explains what changed between them. Nothing is changed by asking. New branch starts a draft from any commit, so you can work without touching what customers get. When a commit is ready, make it live. Customers get exactly that commit until someone makes another one live.

The developer docs, the API and the CLI call a branch a version and a commit a revision. They are the same things (apollo version is the same command as apollo branch).

#Why it works this way

  • Several people can work at once. Each person can work on their own branch and test it in the Playground while customers keep getting the live commit.
  • Pushing never changes what customers get. A push only adds a commit. Making a commit live is a separate, deliberate action.
  • Any commit can be made live, including an older one. That is how you roll back.

#The branch pill

The top bar's breadcrumb ends with the branch pill. It shows the tag of the commit you have open. Select it to open the Branches window. A Beta chip beside the pill means this branch runs on the Beta runtime.

What you have open decides three things:

  • which commit a new conversation in the Apollo-1 Runtime pane runs against,
  • which program files the Program files view (</>) in the builder shows,
  • which branch the Agent Builder works on, and so where your next push lands.
The branch pill shows the commit you have open.

#The Branches window

The header counts the agent's branches and commits and names the branch that is open. Below it:

  • A search field (Search by name, user, branch or commit message…), Compare and New branch.
  • Currently open: the branch you are on, pinned at the top.
  • Other branches: the branch holding the live commit first, then the most recently changed.
  • Archived, folded at the bottom: branches someone retired, each with Restore.
The open branch is pinned at the top, with other branches listed below it.

#What a branch card shows

  • Its name and state. Draft means commits can still land on it; Locked means they cannot. Live means it holds the live commit. Locked and live are independent: a draft branch can hold the live commit.
  • Its newest commit with the commit message, who pushed it and when, and the commit it was cut from (from followed by that commit's tag).
  • How far it is from live. An up arrow counts commits on this branch that live does not have; a down arrow counts commits on live that this branch does not have.
  • Its commits. Select the commit count to list them, newest first. The newest carries HEAD; the live one carries Live.

#What you can do

On a branch card:

ControlWhat it does
OpenWork on this branch. See Work on another branch, start a draft, and compare commits.
Pull fromOn the open branch only: bring another branch's changes into it.
Rocket iconMake this branch's newest commit live.
Pencil iconRename branch.
Lock iconLock the branch, or unlock a locked one.
Archive iconArchive branch. Not offered on the branch holding the live commit.

On a commit row:

ControlWhat it does
The row itselfOpen this exact commit.
Compare iconAsk the builder what changed since the previous commit.
Branch iconNew draft from this commit: start a new branch from it.
Merge iconOn another branch's commits: bring that commit into the branch you have open.
Rocket iconMake this commit live.

Hover over any icon to see what it does. Making a commit live, locking and archiving are covered in Make a commit live, lock a branch, and roll back.

Was this article helpful?