Branching

Branching is only available to Enterprise customers upon request.

Overview

Branching in Plasmic Studio can help you and your team to work together more efficiently and explore new ideas without breaking your existing project.

  • A branch is a copy of your project’s main branch (the branch that gets published).
  • Each branch is independent of other branches, so editors can work without affecting other editors.
  • When a branch is ready to be published, it can be merged back into the main branch and published.
  • Alternatively, a branch can be archived without affecting the main branch.

Use cases

Organizing independent work streams

Suppose Alice is editing page A and Bob is editing page B. Alice’s work on page A is ready, and she wants to publish her changes first. However, Bob’s work on page B is unfinished and can’t be published yet. Without branching, to unblock Alice, Bob would need undo all his changes to page B first, let Alice publish page A, then redo all his changes to page B.

Branching is designed to simplify this common workflow. Alice and Bob can each create separate branches and independently publish their work when ready.

Exploring new ideas

Have an idea but worried you might mess up your existing work? Branching can solve this too. When you make changes on a branch, it won’t affect the main branch. If the idea was successful, merge it into the main branch. Otherwise, archive it.

Git integration

Git is a developer tool for version control of code. We are working on making Plasmic branching work with Git!

How to use branches

Look for the icon on the top toolbar and click it to open the branching panel. The branching panel is where you can perform the following actions:

  • Create new branch
  • Switch to another branch
  • Rename, duplicate, archive, delete existing branch

Creating new branches

Branches are created based on the latest published version of the main branch. If your project doesn’t have a published version yet, you’ll be prompted to publish a version first.

When you create a new branch, Plasmic Studio makes a copy of your project. A branch is completely separate from other branches; actions on a branch have no effect on other branches.

Loading branches in code

When integrating with code (either by Headless API or codegen), wherever you can specify a version, you can specify the name of a branch---this will load the latest published version (or latest draft version if specified) on that branch:

Copy
initPlasmicLoader({
...
version: 'my-branch-name',
// For latest draft version instead of published version:
// preview: true
})

Merging into the main branch

When you’re done editing a branch, you’re ready to merge it into the main branch. Click the top-right “Publish” button to open up the merge dialog. Here, you can view the changes in the current branch and the main branch.

Plasmic Studio will automatically merge branches together, as long as they don’t conflict with each other. For example, suppose the background color was changed to red in the current branch, but blue in the main branch. Instead of guessing which background color to use, the merge dialog will show the conflicting changes, and let you decide which branch’s changes to use.

Updating from the main branch

Since branches are copied from the main branch at a point in time, later changes to the main branch will not be reflected in existing branches. Sometimes, you may want to bring the latest changes from the main branch to your current branch to work off of.

Next to the top-right “Publish” button, click the dropdown arrow and then “Update from main branch”. A similar merge dialog should pop up, because you’re effectively merging the main branch into the current branch.

Best practices

Use descriptive branch names

Branch names are there to help your teammates and future self understand what the branch is for. You can also rename a branch by right-clicking them in the branching panel.

Archive old branches

The branching panel shows active branches at the top and archived branches at the bottom. If you’re no longer working on a branch, archive it so your important branches stay at the top. Note when you merge a branch, Plasmic Studio will automatically archive it for you.

Was this page helpful?

Have feedback on this page? Let us know on our forum.