Troupe Docs
Git

Branches and stashes

Switch and create branches, and put unfinished work aside.

Switch to another branch or start a new one without leaving Troupe. When you are not ready to commit, stash your changes to put them aside and bring them back later.

Switch branches

  1. Open the Changes panel: click Changes in the tool strip at the right edge of the window.
  2. Click the branch name at the top of the panel. If you have commits that are not pushed yet, the button also shows how many, for example ↑2.
  3. Click a branch. The menu lists all branches, including remote ones.

If you have uncommitted changes, Troupe asks what to do with them:

  • Bring Changes keeps your changes and carries them to the new branch.
  • Stash & Switch stashes your changes, switches, and then applies them again on the new branch. If they do not apply cleanly, they stay in the stash and Troupe tells you so. See Stash your changes.
  • Cancel stays on the current branch.

The Uncommitted Changes dialog with the Bring Changes and Stash & Switch buttons

New files count as uncommitted changes here.

Create a branch

A new branch starts from the commit you have checked out. Troupe switches to it right away. Your uncommitted changes come with you.

  1. Click the branch name at the top of the Changes panel.
  2. Click Create new branch....
  3. Type a name in Branch name, for example feature/new-login.
  4. Click Create & Switch.

You cannot switch while an agent is working

While an agent is working in a checkout, Troupe does not switch the branch of that checkout, because a switch would change the files the agent is editing. Troupe shows an error and stays on the current branch.

Wait for the agent to finish, or stop its turn, and then switch again. To keep working on another branch while the agent runs, use a worktree.

If you chose Stash & Switch and the switch was refused, your changes stay in the stash. Apply or pop the stash to get them back.

Stash your changes

A stash saves your uncommitted changes and removes them from your files. Later you apply the stash to bring the changes back, on this branch or another one.

  1. At the top of the Changes panel, click the box icon next to the branch name (Stash changes, or Stashes with a count when you already have stashes), then click Stash changes.
  2. Optional: type a message, so you can recognize the stash later.
  3. To stash new untracked files too, select Include untracked files. Without it, new files stay where they are.
  4. Click Stash.

The Stash Changes dialog with a message and the Include untracked files option

Stash changes is off when there is nothing to stash.

Apply, pop, or drop a stash

Click the box icon at the top of the Changes panel. Your stashes are listed under Stashes, newest first. Each one shows its name, such as stash@{0}, and its message. Point to a stash to see its actions:

  • Apply brings the changes back and keeps the stash, so you can apply it again.
  • Pop brings the changes back and deletes the stash. If the changes conflict with your files, the stash stays in the list.
  • Drop deletes the stash without applying it.

Drop does not ask for confirmation. The stash is gone right away.

This picture shows an older layout. It will be replaced.

An older layout: the Stashes section with one stash and its Apply, Pop, and Drop buttons. Stashes are now in the menu of the box icon.

On this page