Link to Git
Published 01 August 2017
Git in TFS/Azure DevOps
If you're using TFS / Azure DevOps Server / Azure DevOps Services with Git-based version control, you should use Git mode to link.
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:
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.