Team Foundation Service is Microsoftâ€™s hosted TFS, and supports both Git and TFS source control. TFS(ervice) is free for teams up to five, and all repos are private. If you need a Team Foundation Service account, go to http://tfs.visualstudio.com and log in with your Microsoft ID. If youâ€™re using Git, youâ€™ll also need to create an alternate set of credentials to connect to the repo.
In SQL Source Control, Git is now a top-level provider, but full Git support hasnâ€™t been implemented yet (Subversion and TFS have much better support in the current version, 3.4 at the time of this post). For the current version of SQL Source Control, youâ€™ll still need to switch to your favorite Git tool for add/commit/push. Upcoming features in SQL Source Control for Git include better branching support and support for migrations. Migrations allow you to alter schema objects without dropping them firstâ€”like changing the name of a table without dropping it firstâ€”as well as seeding initial data.
1. Create project in TFS
2. Navigate to Code tab, clone the repo in your favorite Git tool using the URL provided. TFS only supports HTTPS right now, so you need a set of alternate credentials to use Git.
3. In SSMS, right-click the database you want to put under source control and select â€œLink database to source controlâ€.
4. Then, browse to your working folder and select whether each developer will have their own copy of the database, or everyone will work from one central database.
5. Once the database has been linked, click on the â€œCommit Changesâ€ tab and choose â€œSave Changesâ€. For a Git repo, this just saves the script filesâ€”you still need to do an add, commit and push in your favorite tool.
6. Once youâ€™ve done an add/commit/push, you can log into TFS again and use all the functionality of diffs, history tracking, etc. Your other team members can pull from this repo and use SQL Source Control to easily keep their instances up to date.