Switch between branches

Last modified: January 30, 2024

dbForge Source Control allows performing a number of operations with branches.

Switch branches using the Get Latest operation

Note

You can use this method when working with Git, a working folder, or a custom version control system.

To switch between branches:

  1. Check out the required branch
  2. Refresh Source Control
  3. Click Get Latest

Suppose your local database is synchronized with a specific branch of the remote repository, and Source Control shows No changes. To switch to another branch, first, check out the required branch. Then, return to Source Control and perform Refresh. Source Control will display the differences between your local database (matching the old branch) and the newly selected branch. Clicking Get Latest will update your local database to match the new branch.

If you are working on a database in SSMS, this procedure will help you link it to the required branch in your source control system.

Having created a new branch, unlink your database in Source Control. To do that, go to Object Explorer and right-click the database. On the shortcut menu, point to Source Control, click Unlink Database from Source Control, then click Yes to confirm.

Afterwards, right-click your database again. On the shortcut menu, point to Source Control, click Link Database to Source Control and indicate the location of the new branch in source control.

Create a new database for your branch

Note

This applies only to the dedicated development model.

After you created a new branch in your source control system, create a new empty database in SSMS. Then, go to Source Control, link the new database to the source control system, and specify the location of the repository folder that holds the selected branch.

Afterwards, perform the Get Latest operation to update your new database with the latest version from your source control.