문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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

Be sure to get your DB connection right

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top