Create or Switch a Branch

When you create a visual application with a Git repository (instead of a scratch repo), VB Studio creates two branches in the repo: the default branch (usually, main) and a working branch.

The main branch contains the initial set of source files for the visual application. The working branch contains the same set of source files initially, but as you work on your visual application, this branch will contain the changes that you make. Using the Switch Branch option, you can switch branches and commit your changes to the branch you switch to, or create a new branch from the branch you are currently working in.

Note:

You don't have to switch to another workspace to configure another page in your application, as long as the target for your change is in your current Git repository. It's much faster to switch branches within a workspace than to switch workspaces. For example, suppose you're working in a Git repo for the Expenses application. While configuring the Create Expense Report page, you get an urgent request to fix something in Expense Details page and deploy it to your production instance. Rather than create a new workspace, you simply create a new branch, make the fix and publish it, then switch back to the Create Expense Report page code line and resume your work.

You use the Switch Branch dialog to switch branches or create a new branch from the existing branch that you are working on.

  1. Click the Git menu in the header, next to the name of the current branch.
  2. Select Switch Branch.

    The Switch Branch dialog displays the current branch in the Branch drop-down list and the number of uncommitted files, if any.

  3. Choose the appropriate option:
    • To switch branches, select the branch that you want to switch to and click Commit and Switch or Switch. The button’s label depends on whether you selected the Commit changes before switching (recommended) check box.
    • To create a new branch, select the New branch from selected check box, enter the name for the new branch, and click Commit and Switch (or just Switch).