Working as a Team with Git

DbSchema saves the entire database design — tables, columns, foreign keys, and diagrams — into a single .dbs file (XML format). Storing this file in a Git repository gives your team a complete, versioned history of every schema change, with the ability to branch, merge, and roll back just like with source code.

Why Git for Database Design

  • Track every change — see exactly what was added, removed, or altered, and by whom
  • Collaborate without conflicts — each developer works on their own branch and merges when ready
  • Manage environments — maintain separate branches for development, testing, and production
  • Audit and rollback — revert to any previous schema version at any time

The Workflow

The typical team workflow with DbSchema and Git looks like this:

  1. A developer designs or modifies the schema in DbSchema and saves the .dbs file
  2. The .dbs file is committed and pushed to the shared Git repository
  3. Teammates pull the latest file and open it in DbSchema
  4. DbSchema's Synchronize feature compares the .dbs file against the live database and generates the SQL needed to bring it up to date

This means database changes travel the same path as code changes — through pull requests, code review, and controlled merges.

Configure Git in DbSchema

To get started you need a repository URL from a hosting provider (GitHub, GitLab, Bitbucket, or a self-hosted Git server).

  1. Open DbSchema and go to the Model menu
  2. Choose Git — Collaborative Design to open the Git dialog
  3. Enter the remote repository URL and your credentials
Git dialog in DbSchema

Clone a Repository

In the Git dialog, paste the repository URL and choose an empty local folder to clone into. DbSchema will download the repository contents to that folder.

After cloning, open the .dbs file from the Model menu. You can have multiple .dbs files in the same repository — one per database or project component.

Stage, Commit, and Push

To share your changes with the team:

  1. Stage — select the modified files in the Git dialog and click Stage to move them to the staging area
  2. Commit — enter a descriptive message and click Commit to save a snapshot in your local repository
  3. Push — click Push to upload your commits to the remote repository so teammates can access them

GitHub and Bitbucket require authentication before accepting a push (see the Authentication section below).

Pull Changes from the Remote

To download the latest schema changes from teammates:

  1. Open the Git dialog and click Pull
  2. DbSchema fetches and merges the latest commits into your local working directory
  3. Review the updated diagram, or use Compare with Current to open the Synchronization Dialog and see exactly what changed
  4. Use the Synchronization Dialog to apply the differences to your local database or generate an SQL migration script

Advanced Features

The Git dialog in DbSchema also provides:

  • Stash — temporarily save uncommitted changes so you can switch branches or pull updates without losing your work
  • Pop — restore the most recently stashed changes back into your working directory
  • Create Branch — create a new branch to isolate work on a feature or environment without affecting the main branch

SSH Key Authentication

You can authenticate with a username and password. For GitHub and Bitbucket, use a personal access token instead of your account password.

If you prefer SSH key authentication and encounter issues, convert your private key to classic OpenSSH format:

ssh-keygen -p -f <privateKeyFile> -m pem -P passphrase -N passphrase