Question

My team and I are creating an ASP.NET MVC site using Entity Framework Code First.

We all want to share the same initial data that exists on my computer, but I really don't want to manually write Seed code for all of the data that I have entered in my local database.

How can I configure my current LocalDb so that it can be shared with everyone else using Git?

Was it helpful?

Solution

You will need to include your database file (.mdf and .ldf) in your git repo for this project. So get everything setup locally like you want it in your database. Push your local repo to the centralized repo. And have everyone else clone that repo as a starting point. That will give everyone the same starting point. If you don't want that to change anymore, everyone will need to add the database files (.mdf and .ldf) to the .gitignore file. Or just make sure that you don't git add those files and commit them unless you want everyone else to get those changes.

OTHER TIPS

You can export and import your data using microsoft server SQL management studio

Be sure to get your DB connection right

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top