Documentation / Projects and Collaboration

Branches and Stashes

Create and switch branches in Workspaces, and choose where your unpublished changes go when you switch.

A branch is a separate line of work in a cloud project, so you can try an idea without changing the main design. A stash keeps changes you haven't pushed yet on a branch while you work somewhere else.

A branch is not a design variant. Variants choose which parts are fitted on one design; branches are separate versions of the whole project.

Check which branch you're on

Current Branch, at the top of Workspaces, shows the branch your working copy is on. The editor shows that branch's files. Check it before you edit, and before you ask the assistant to change the design.

Create a branch

  1. Open Current Branch.
  2. Type a name in the new branch field, for example feature/usb-c. The name is kept exactly as you type it.
  3. Press Create, then Confirm create.

The new branch starts from the branch you're on, as it was last pushed. Trace says Created NAME. You are still on BRANCH: creating a branch doesn't switch to it.

Switch branches

  1. Save your schematic and board.
  2. Open Current Branch and pick the branch.

If everything is pushed, Trace switches and reloads the editor. Your project keeps its place and colour in the Open Projects list while the files download.

If you have unpublished changes

New in Trace 3.2: Trace asks Where should your unpublished changes go?

ChoiceWhat happens
StayNothing changes. You stay on this branch with your changes.
Move changes to other branchYour changes come with you and are merged into the other branch. Files that changed on both branches wait for your choice before anything is applied.
Leave changes on this branchYour changes are kept in a stash on this branch, and you switch without them.

Neither choice pushes anything. To publish your changes before you switch, press Commit or push first…, type a summary and press Commit or Push. The switch carries on afterwards.

Commits you haven't pushed can't be moved to another branch. If you have some, Trace offers Push and Leave changes on this branch instead of Move.

If a schematic or board has unsaved edits, Trace asks you to save or discard them before it switches.

When the move finds files changed on both branches

Changes lists each file that changed in your work and on the other branch. For each one, choose Keep target branch or Take my changes, then press Apply. Until you apply, your work also stays in a stash on the branch you left. To give up, press Stop move, keep stash.

Come back to stashed changes

New in Trace 3.2: when you come back to a branch where you left changes, Changes shows Stashed changes on BRANCH with two buttons:

  • Restore merges them back into what's on the branch now. Nothing is pushed.
  • View stash opens the Stashes tab, where you can see each file.

If a file changed both in the stash and on the branch since you left, choose Keep current file or Take from stash for it, then press Apply. The stash is kept until the restore finishes. To give up, press Stop restore, keep stash.

Restored changes are on this computer only. Check them, then commit and push as usual.

Manage stashes

The Stashes tab lists the stashes on the branch you're on. Select one to see its files, then:

  • Restore stash brings it back, as described above.
  • Discard, then Discard stash, deletes it. This can't be undone.

A stash belongs to the branch you left it on. Switch to that branch to restore it. A project can hold up to 64 stashes. At the limit, Trace refuses a new stash before it switches; discard ones you no longer need.

Compare and delete branches

In Current Branch:

  • Compare beside a branch shows how it differs from the branch you're on.
  • Delete, then Confirm, removes a branch from the list. Its pushes and your open files are kept. You can't delete the default branch or the branch you're on.

Don't delete a branch to get rid of changes you haven't pushed. Use Discard changes or Discard stash instead, and only for work you're sure you don't need.

Branches and your design settings

  • Your design rules and Board Setup settings stay as they were after you switch branches. Before Trace 3.2, they could reset to a new board's defaults.
  • A Trace Mechanical case's saved build files don't block a branch switch.

If a switch or move doesn't finish

From Trace 3.2, Workspaces says in plain words what happened and what to press next:

  • The branch switched, but your changes didn't come over, for example because an open file had unsaved changes. Your changes are kept in a stash. Save your open files, press Check again, then Apply in Changes.
  • Trace closed while the move waited for your choices. Press Resume move to choose again, or stop the move.
  • The other branch's files couldn't be downloaded. Your changes stay in a stash, the project is free to use, and Workspaces says why the download failed.

Don't restore, discard or switch again while Workspaces is still checking. More fixes: If something goes wrong.