Work on another branch, start a draft, and compare commits

Open another branch or commit, start a draft branch, bring changes across, and ask the builder what differs between two commits.

UPDATED NOVEMBER 25, 20267 MIN READ

You work on one branch at a time. The branch, or the exact commit, you have open decides what your conversations run against, what the Agent Builder works on, and where its pushes land. The Branches window, where you move between branches, also lets you compare any two commits before you open one or make it live.

#Which one do I need?

Most work on branches comes down to a handful of situations. Find yours, then follow the section it points to.

You want to…Do thisSection
Try a change without touching the branch your team is working onStart a new draft branch, make the change there, test itStart a new draft branch
See how the agent behaved before a changeOpen the earlier commit and talk to itOpen a branch or a commit
Keep working from an earlier commit after the branch has moved onBranch from mine on the bannerWhat HEAD means
Use a teammate's work in your branchPull from their branchBring changes from another branch
Review a branch before it goes liveCompare it with the live commitCompare two commits
Find out which commit changed a behaviorAsk what one commit changedSee what one commit changed

#An example from start to finish

ACME Air's agent is live on Initial Branch. The team wants to try a new cancellation rule without disturbing it:

  1. They start a draft branch called Cancellation policy from the commit before any fee existed, so the draft begins from known behavior.
  2. On that branch they ask the Agent Builder to add a USD 15 convenience fee for cancellations made through the agent, test it in a conversation, and push. The branch now has two commits: the starting point and the fee.
  3. A teammate who still has the first commit open sees the moved on banner and selects Open head to catch up.
  4. Before anyone makes it live, they ask what changed since the previous commit. The builder answers by area: the cancellation flow, the cancellation results, and what gets recorded.
  5. Customers are still served by the live commit on Initial Branch throughout. Nothing changes for them until someone makes the new commit live. See Make a commit live.

#Open a branch or a commit

  1. Select the branch pill in the top bar to open the Branches window.

  2. Under Other branches, find the branch and select Open.

    To open one exact commit instead, select the branch's commit count to list its commits, then select the commit's row.

  3. The card moves up to Currently open and the branch pill shows the tag you opened. Close the window to get back to work.

Opening a branch keeps you on its newest commit, including commits other people push after you open it. Opening a specific commit keeps you on that commit.

Opening another branch: the pill shows where you are now.
Click Open on a branch to work on it.

#What changes when you open another branch

  • New conversations run on the commit you opened. A thread stays tied to the commit it ran on: if you open a thread from a different commit, the composer says This conversation ran on that commit and waits until you switch to it, using the Current commit picker beside the note.
  • The Agent Builder starts fresh on that branch: your next message opens a new session there. Sessions you had on other branches stay in All sessions, and any unsaved changes stay with the session that made them. Push them first if you want them kept as a commit.
  • The Program files view (</>) shows the commit you opened.

#What HEAD means

HEAD marks the newest commit on a branch, the one the next push builds on. If you open an older commit of a branch, a banner at the top of the Branches window says the branch moved on, and that a push from where you are would be refused. Choose one of:

  • Open head to move to the newest commit,
  • Branch from mine to start a new draft branch from the commit you have open,
  • View diff to ask the builder what changed between your commit and the head.

The same banner appears when a teammate pushes to your branch while you have an older commit of it open.

Open an older commit, then return to the head.

When to use each. Open an older commit when you want to see or show how the agent behaved before a change: talk to it, read its program, then go back with Open head. Choose Branch from mine when you want to keep building from that older point, for example to try a different approach than the one the branch took.

Open the head, or keep your commit on a branch of its own.

#Start a new draft branch

  1. In the Branches window, select New branch. To start from a particular commit, select the branch icon on that commit's row (New draft from this commit) instead.
  2. Under Name, type a name, or keep the suggestion: the source branch's name followed by (continued).
  3. Under From branch and At commit, choose where to cut the branch. Both start on what you have open.
  4. Select Create branch.
Starting a draft from an earlier commit.

The new branch becomes the one you have open. Nothing on the source branch changes. If you cut from an older commit, the dialog reminds you that everything committed after it stays on the source branch.

Good reasons to start a draft branch

  • To try something you may throw away. A draft costs nothing to abandon: archive the branch and the source is exactly as it was.
  • To work alongside someone else. Two people on two branches never overwrite each other's unsaved work.
  • To prepare a change while the live commit keeps serving customers. Make it live only when it has been tested and compared.

#Bring changes from another branch

To bring another branch's work into the branch you have open:

  1. On the Currently open card, select Pull from.
  2. Under From branch and At commit, pick the commit to bring in.
  3. Select Pull in.

The Branches window closes and the Agent Builder does the work in Build mode: it brings the clean changes in, tells you what needed a decision and how it settled it, then validates the program. The result is unsaved changes, so test them, then push. See Unsaved changes and Push.

You can start the same thing from the other end: on a commit row of another branch, select the merge icon, whose tooltip reads Bring followed by the commit and your branch's name.

#Compare two commits

Compare tells you what differs between two commits of your agent, by area and in plain words. The Agent Builder reads both programs and answers in its pane. Nothing is changed by asking. Use it before you make a commit live, to review a teammate's branch, or to find out when a behavior changed.

  1. Select the branch pill in the top bar to open the Branches window.
  2. Select Compare. The Compare two commits dialog opens.
  3. Under Base and At commit, check the first commit. It starts on the branch and commit you have open; change either if you want to read from somewhere else.
  4. Under Compare with, pick a branch (Pick a branch…), then its commit under At commit. The commit list marks which commit is the newest and which is live.
  5. Select Compare.

The Branches window closes and the builder answers in Ask mode, area by area, reading the base as the one you start from. If you pick the same commit on both sides, the dialog asks you to pick two different commits.

Pick the two commits; the builder does the reading.
The answer is grouped by area, in plain words.
  • Before going live, compare the live commit with the commit you are about to make live. Expand the branch that is marked Live to find the live commit.
  • Ask follow-up questions in the same builder session, for example "Which kinds of conversation would behave differently?"

#See what one commit changed

Each commit row in the Branches window has a compare icon. Its tooltip reads What changed since followed by the previous commit, or What changed in this commit? on the first commit of a branch. Select it and the builder explains what that commit changed compared with the one before it.

One click on a commit asks the builder what it changed.

This is the quickest way to find when a behavior changed: start at the newest commit and ask each one in turn until the answer mentions it.

#From the CLI

If you work from the CLI as well, apollo pull after a Playground push keeps your checkout current, and apollo merge-from brings another branch's changes in locally. See the CLI workflows. For a line-by-line diff of the program files, use apollo diff <tag> <tag> with the tags of the two commits. See the CLI command reference.

Was this article helpful?