Merge branches

dbForge Source Control allows three ways of merging branches.

Merge branches using your version control system

This approach is generally recommended for complex merges or merges with conflicts - for instance, if the same object has undergone changes both in your branch and main branch. In this case, the changes in your branch can be merged into main branch via a source control system. You only need to make sure that the references between your objects have remained intact after merging.

Merge branches using dbForge Source Control

You can also merge branches via dbForge Source Control:

1. Go to Source Control and make sure there is a database linked to the required branch in your repo folder.

2. Get the latest version and commit your changes, if any.

3. Unlink the database from your branch.

4. Relink the database to main branch.

5. In Object Explorer, right-click a linked database that you need to update. On the shortcut menu, point to Source Control and click Commit.

6. Wait until the refresh is complete and Source Control Manager opens, showing the changes to your branch.

7. If there are conflicts, select the required way to resolve your conflict:

  • Get Local - your version of the object/data will be committed to source control
  • Get Remote - your changes will be discarded; your local database will be updated with the latest version of the object/data from source control

8. Click Commit. The Commit dialog box opens, showing the stages of the commit operation. When all the stages are completed, click OK to close the dialog box.

Merge branches using dbForge Schema Compare

If there are no conflicts between your branch and main branch, you can perform merging via dbForge Schema Compare:

1. Go to Source Control and make sure there is a database linked to main branch.

2. Use your source control system to create a local copy of the latest version of your branch.

3. Go to dbForge Schema Compare and create a new project. Set the local copy of your branch as Source. Then set the database linked to main branch as Target (refer to Setting data sources for details).

4. Compare your data sources, check the differences, and deploy them from Source to Target (refer to Deploying schema changes for details).

5. Go back to dbForge Source Control. In Object Explorer, right-click a linked database that you need to update. On the shortcut menu, point to Source Control and click Commit.

6. Wait until the refresh is complete and Source Control Manager opens.

7. Click Commit. The Commit dialog opens, showing the stages of the commit operation. When all the stages are completed, click OK to close the dialog box.

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Source Control for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Source Control in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Source Control for your business, request a demo to see it in action.
Ready to start using dbForge Source Control for SQL Server?