You can source-control your database with Git, Mercurial, or any other source control system by linking your database to a working folder in your repository.
When you save changes, SQL Source Control scripts out the changes to the working folder as SQL script files. After saving database changes, you can add and/or push and commit the script files manually with your source control client.
If you want to do atomic commits of your database schema together with your application code, you can do this by linking to a working folder. For more information, see Worked example - source-controlling database schema and application code together using a TFS workspace.
Linking to a working folder
- Create an empty folder in your source control repository. This will be your working folder.
- In the Link to source control dialog box, in the left pane, select Git or Mercurial. For other source control systems, select Working folder.
- Specify the location of the working folder you created in step 1.
Your database is linked to the working folder.