BitBucket is a web-based version control solution designed for software development teams. It supports Git repositories to help users manage and collaborate on their projects. Also, developers can track and revert changes, and work on different branches simultaneously. BitBucket offers various services, including code review, issue tracking, continuous integration and deployment, and integrations with other software development tools like Jira and Confluence.
Prerequisites
The guide covers the following topics:
1. Sign in to your Bitbucket account.
2. At the top of the page, click Create > Repository. Alternatively, you can click Create repository in the Recent repositories or Welcome sections.
3. On the Create a new repository page that opens, add the repository details:
4. Click Create repository to create the new repository on Bitbucket.
1. Create an empty folder on the disk of your computer to store the local repository - for example, a bitbucket folder stored on the drive D.
2. Sign in to your BitBucket account, navigate to Repositories on top of the page, and then select the repository you want to clone to your computer.
3. In the upper-right corner of the repository page, click Clone.
4. In the Clone this repository window that opens, select either HTTPS or SSH as the connection protocol, and copy the clone command with the repository URL. HTTPS, a default option, supports user/password authentication and SSH - public key authentication. In our example, we use HTTPS.
Note
When cloning over SSH from a Bitbucket repository, the user’s public key needs to be added to the Bitbucket account and saved on the local computer they are using to clone the repository. This operation allows for secure authentication between the local computer and the Bitbucket server.
5. Start Windows Command Prompt (CMD). Use the cd
command to change the disk drive and navigate to the empty folder you created.
6. In the Command Prompt, paste the clone command with the repository URL to create a cloned copy of the repository in the local folder (bitbucket in our case). Since the HTTPS protocol has been selected, you will be prompted to enter the username and password to your BitBucket account.
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, follow these steps:
7. Execute the git commit --allow-empty -m initial
command.
8. Execute the git push
command to push the cloned repository to Bitbucket.
After you cloned the remote repository to the folder on your local computer, you can link the database to source control using the dbForge Source Control add-in for SSMS.
1. In Database Explorer, right-click the 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 dialog that opens, click + in the Source control repository field.
3. In the Source Control Repository Properties dialog that opens, do the following:
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. In the Link Database to Source Control dialog, select a database development model: shared or dedicated.
5. Click Link to establish the connection between the database and the repository.
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.