Documentation

Support

Unity Version Control

Switch to branch

From the Unity Editor, update your local workspace to a specific branch.
Read time 2 minutesLast updated 9 days ago

Use the Switch workspace to this branch feature to update your local workspace to a specific branch. Switch to an existing branch in the Unity Version Control window:
  1. Select the Branches icon, and then select Branches to open the Branches tab. If the tab is already open, you can directly select Branches.
  2. Right-click the branch you want to switch to.
  3. Select Switch workspace to this branch.
  4. In the dialog, select Switch.

Switch with pending changes

When you switch to a different branch, you might have pending changes in your local workspace. To determine how Unity Version Control (UVCS) handles the switch, configure the Behavior when trying to switch/update the workspace with changed items setting.

Shelve and Switch

The default behavior is Shelve, which shows you a dialog with two options to decide what to do with the pending changes:

Leave changes

Select this option to leave the pending changes on your current branch. This lets you switch to the new branch cleanly as if your workspace didn't have any changes. If you switch back to the original branch, you can re-apply the changes in your workspace and continue to work on them. For example, this option is helpful if you're working on one branch but want to quickly check something on an unrelated branch, or a previous changeset on the same branch. UVCS automatically creates a shelveset with your pending changes, and detects when you switch back to the branch to offer you the option to apply the changes.

Bring changes

Select this option to keep pending changes across the switch. Your local workspace switches to the new branch and brings the pending changes so you can check in the changes in the destination branch. For example, this option is helpful if you accidentally make changes on a branch you didn't mean to, and want to bring the changes to the correct branch.