Link to Git
Published 01 August 2017
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.
- In the Object Explorer, select the database you want to link to source control.
- In SQL Source Control, on the Setup tab, make sure Link to my source control system is selected and click Next:
- On the Link to source control dialog, select Git.
The Link to Git page opens:
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.- 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:
After you link
If you're the first person to link this database
Add the database objects to source control:
- Go to the Commit tab and commit the objects.
- 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:
- Go to the Get latest tab and click Pull from remote repository.
- Click Apply changes to database.
The schema from the local repository is deployed to the database.