Link a SQL Server Database Project to a Git Repository

Introduction

Continuous Integration has become practice to many development project. Did you know, we can achieve that in SQL Server Project in Visual Studio as well!!. Much needed one !!! There is a relatively easy path to get our databases into Database Projects (which we discussed in previous article), and ultimately source control. Implementing proper database code branching in Git or a similar source control can help you speed up database development, testing, refactoring and deployment there by creating a smooth and effective Database Lifecycle Management (DLM) process. In this article, we will discuss How to Link a SQL Server Database Project to a Git Repository.

Link SQL Server Project to a Git Repository

For better understanding, I would recommend to read the  previous article before getting into this.

  • Open Visual Studio and Navigate to our SQL Server Database Project, which we have already created.
Fig.1 Open existing SQL Server Project in Visual Studio
  • Click Git menu, Create Repository from the Visual Studio Menu Bar
Fig.2 Choose Git option from the Menu Bar
  • Or choose Git Changes next to Solution Explorer. Click Create Git Repository.
Fig.3 Git Changes
  • In this article, I am explaining about the GitHub repository and I have already logged in into the GitHub in Visual Studio. You should also sign in into the GitHub in Visual Studio.
Fig.4 Create a Git Repository
  • Once we click Create a Repository from the options, it prompts us to enter the repository details like, Repository Name (By default the SQL Server Project Name will be set), Description about the project and Checkbox to enable if the repository is Private.
  • After entering the required fields, Click Create and Push button
Fig.5 GitHub Repo
  • If we navigate to GitHub, we can see our new project there.
  • This project’s Git Repo.

Now it will be easy to manage the SQL Objects for a database, when more developers works at the same time and no need to worry about the integration process as well. By using the Schema Compare in Visual Studio we can manage the Newly added objects or modified objects in SQL server Database, which we will discuss in my next article.

Conclusion

In this article, We have discussed, How to link our SQL Server Database Project with GitHub. In my next article, we will discuss how to use Schema Compare Tool in Visual Studio to manage the changes in SQL Server. I hope you all found this article/ tip useful. Please share your feedback in the comment section.

Consider reading other SQL articles of Mine

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Website Built with WordPress.com.

Up ↑

%d bloggers like this: