SQL Source Control 6

Link to Git

Git in TFS/VSTS

If you're using TFS/VSTS with Git-based version control, you should use Git mode to link.

You will be able to commit and get latest as normal, but push and pull support will not work from within SQL Source Control because the TFS/VSTS authentication method is not currently supported. You can use the Git command line or another Git client to perform push/pull operations

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 Link to source control dialog, select Git
    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 turns green to show that the database is linked:
     

If you're the first person to link this database

Add the database objects to source control:

  1. Go to the Commit 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:

  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?