Applies to
Summary
This article explains how to link a database to the source control repository using the Source control setup window
Description
Using ApexSQL Source Control, a SQL Server Management Studio add-in, developers can link a database to the source control repository directly from SQL Server Management Studio.
Linking process
-
Right-click on the database in the Object Explorer panel, and from the context menu, select the Link database to source control option:
-
The Source control setup window will be displayed:
The Source control setup window consists of five steps (tabs), three mandatory and two optional:
-
Mandatory tabs:
- Connection type
- Development model
- System login
-
Optional tabs:
- Object filter
- Script options
-
Mandatory tabs:
Connection type tab
Under the Connection type tab are present two options:
- Native – requires a source control system to be specified from the Source control system drop-down list. On the Source control system list will be found all supported source control systems:
- Git
- Mercurial
- Perforce
- Subversion
- Team Foundation Server (Azure DevOps Server/Services)
-
Working folder – allows linking a database to a file system folder without any source control system. This feature is convenient, e.g., evaluating purposes
Development Model tab
Under the Development model tab, one of the two supported development models must be chosen to work with the source control systems:
|
Quick tip: When you link a database on which multiple developers will work at the same time, the Shared database model is suggested |
System login
Connecting to a source control repository requires appropriate login information to be provided as well as some additional information specific to the chosen source control system.
Here’s how login forms and the repository string specific to each source control system look like:
Git
The Repository path form:
<protocol>://<hostname>:<portnumber>/<Git server name>/<repository>
- <protocol> – can be HTTP, HTTPS or SSH
- <hostname> – the machine hostname, a NetBIOS name or a DNS machine name that hosts the Git Server
- <portnumber> – port 8443 is used by default
- Using <Git server name> in the repository path is mandatory
- <repository> – the name of the Git repository to connect to
|
Quick tip:
When connecting to a Git, Mercurial, or Subversion repository hosted in the local machine file system, the following form of the repository path is advised: |
Mercurial
The Repository path form:
<protocol>://<hostname>:<portnumber>/<repository>
- <protocol> – can be HTTP, HTTPS or SSH
- <hostname> – host machine, NetBIOS, or DNS name
- <portnumber> – port 8443 is used by default
- <repository> – the name of the Mercurial repository to connect to
Perforce
The Host path form:
<protocol>://<hostname>:<portnumber>
- <protocol> – can be TCP which is the default, or SSL
- <hostname> – the machine hostname, a NetBIOS name, or a DNS machine name that hosts the Perforce server
- <portnumber> – port 1666 is used by default
Subversion
The Repository path form:
<protocol>://<hostname>:<portnumber>/svn/<repository>/
- <protocol> – can be HTTP, HTTPS, SVN or SSH
- <hostname> – host machine, NetBIOS, or DNS name
- <portnumber> – port 8443 is used by default
- <repository> – the name of the Subversion repository to connect to
Team Foundation Server (Azure DevOps Server/Services)
The Repository path form::
<protocol>://<hostname>:<portnamber>
- <protocol> – can be HTTP or HTTPS
- <hostname> – host machine, NetBIOS, or DNS name
- <portnamber> – port 8080 is used by default
|
Quick tip: When connecting to Azure DevOps Services, use the email address as a username and Token, created under user profile options, as a password |
Object filter tab
This step provides a possibility to exclude objects from a database on which changes will not be tracked. It is possible to exclude specific objects, exclude objects by owner or type. More about this topic can be found in the Object filtering article.
Script options tab
This step of the Source control setup window is about setting the Ignore comparison and the Synchronization options for the selected database. More about options under this tab is explained in the Script comparison and synchronization options in ApexSQL Source Control article
After the database is linked, the Action center tab will open with all checked objects under the Object filter tab listed:
The linked database and all objects present in the Action center tab, objects checked under the Object filter tab, will have a link icon (blue dot):