Switch to branch

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:

Note: The Shelve and Switch behavior is also available when you switch to a changeset or label. When you switch to a label, only the Leave changes option is available because you can't check out a label.

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.

Note: If you select Bring changes, the destination of the switch might contain changes in the same files as your current workspace. You might need to manually resolve conflicts to proceed with the operation. In this case, UVCS performs the switch and you can either resolve the conflicts, or leave them in the shelveset to resolve them later.