Git in TFS/VSTS
If you're using TFS/VSTS with Git-based version control, you can't use TFS mode to link. Instead, you need to link in Git mode.
- 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 Choose your source control system page, select TFS and click Next.
The Link Database to Source Control dialog box opens.
-
In the right-hand pane, in the Server URL field, specify the URL of your Team Foundation Server (e.g. http://tfs/defaultcollection/ for TFS or https://myorganization.visualstudio.com/ for VSTS).
If you use a non-standard port, specify this in the URL (e.g. http://myurl:8080/tfs/). -
In the Database folder field, enter the folder in TFS where SQL Source Control will store SQL scripts.
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. -
If you're linking to a database that will be used by multiple developers, make sure Shared database is selected.
For an explanation of the different models, see SQL Source Control for teams. - 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 linking
If you're the first person to link this database, add the database objects to source control in an 'initial commit'. To do this, go to the Commit tab and commit the objects. For more details, see Your first commit.
If you linked a database that's already in source control, update your database to the latest version. To do this, go to the Get latest tab and get the changes. For more details, see Get the latest version.
Was this article helpful?
Articles in this section
- The process cannot access the file 'C:\Users\*******\AppData\Local\Red Gate\SQL Source Control 7\Caches
- Duplicate definition troubleshooting in SQL Source Control
- The target principal name is incorrect
- SQL Source Control can't access this database - make sure the database is online and you have permission to access it
- Meanings of the colored dots in the SSMS Object Explorer for SQL Source Control
- Last Changed By column shows Unknown
- How to Link SQL Source Control to TFS
- How to link to an existing SVN repository
- GIT Push/Pull greyed out
- Objects changed by unknown