GitHub is a web-based platform for software developers that enables the storage and management of code and the tracking and control of code changes via Git repositories. It makes it easy for developers to collaborate on projects and to create and manage issues, bugs, and feature requests. They can also automate testing, build processes and workflows during deployment by integrating various CI/CD tools.
Prerequisites
The article covers the following topics:
1. Sign in to your GitHub account.
2. In the upper-right corner of the page, click the + dropdown menu and select New repository.
3. On the Create a new repository page that opens, enter the name and optional description.
4. Select the visibility mode:
5. Make an initial commit to the repository by selecting the options:
The default name of the branch is main. If you want to change the name, go to the settings tab.
Note
If you import an existing repository, skip this step.
6. To keep the changes, click Create repository.
1. Create an empty folder on the disk of your computer where the local repository will be stored.
2. In the GitHub account, switch to the Repositories page and select the repository you want to copy to your computer.
3. From the <> Code dropdown menu, select HTTPS and copy the repository URL.
4. Start Windows Command Prompt (CMD) and navigate to the empty folder you created.
5. In the Command Prompt, type the git clone
command, paste the URL directory you’ve copied, and press Enter to create a cloned copy of the repository.
Note
Specify a dot at the end of the command to clone the repository to the folder you have created. Otherwise, another subfolder will be created.
If you didn’t add any files to the repository when you created it for the first time, execute the following commands:
git commit --allow-empty -m initial
git push
1. In Database Explorer, right-click a database you want to link to source control and select Source Control > Link database to Source Control.
Alternatively, select Database > Link Database to Source Control on the ribbon.
2. On the Link page of the Link Database to Source Control wizard, click + in the Source control repository field.
Note
The previously linked repository will be selected by default.
3. In the Source Control Repository Properties dialog that opens, select Git from the Source Control system dropdown list and specify a path to the folder with the cloned copy of the repository in the Repository Folder field. You can specify a path to a subfolder in the repository (not .git).
Note
To work with a remote repository, you need a clone of this repository. To retrieve a local clone, execute the
git clone <url> <path>
command or use the GUI tool. After the successful creation of the clone, specify the path to the folder containing the clone in the Repository Folder field of the Repository Properties window. You can specify a path to a subfolder in the repository (not .git).
Note
The repository folder name represents a path to the local copy of the remote repository and must not contain the URL of the remote repository.
4. Optional: Click Test to verify that the database can be successfully connected to source control.
Note
Keep in mind that you should work with the current repository branch. For this, it should have at least one commit.
5. Click OK to apply the changes and close the Source Control Repository Properties dialog.
6. Select a database development model: shared or dedicated.
7. Click Link to establish the connection between the database and source control.
The Refresh progress window opens automatically, showing the stages of the refresh operation. The linked database gets the following icon in Database Explorer:
If you are the first person to link this database, add the database objects to source control in an ‘initial commit’: go to the Local changes section, select the objects, and click Commit. For more information, see Commit changes.
If you linked a database that is already in source control, update your database to the latest version: go to the Remote changes section, select the objects, and click Get Latest, which is available only in the dedicated model. For more details, see Get the latest version.