SQL Source Control 4

Git

This page applies to SQL Source Control 4.1 and later.

 

This page explains how to link your database to an existing Git repository.

  1. In the Object Explorer, select the database you want to link to source control.
  2. In SQL Source Control, on the Setup tab, make sure Link to my source control system is selected and click Next:
  3. On the Choose your source control system page, select Git and click Next
    The Link to Git page opens:

      

  4. In the Folder field, specify a folder in an existing local Git repository where SQL Source Control will save SQL scripts.
    For example: C:\Repository\DatabaseFolder
    If you're the first person to link the database to source control, specify an empty folder. If someone has already linked this database to source control, specify the folder they used.

  5. Click Link
    The database is linked to source control. The database icon in the Object Explorer changes to show that the database is linked:

If you're the first person to link this database, add the database objects to source control. To do this:

  1. Go to the Commit changes tab and commit the objects. 
  2. Find the blue banner above the commit grid and click Push.
    This pushes all commits from the local repository to the remote repository. 

If you linked a database that's already in source control, update your database to the latest version. To do this:

  1. Go to the Get latest tab and click Pull from remote repository.
  2. Click Apply changes to database.
    The schema from the local repository is deployed to the database.

Didn't find what you were looking for?