Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

TLDR: What is an effective way to use Git to handle ASP MVC code-first EF? Which files need to be included for NuGet? Which files should be left out?

We have an ASP MVC code-first Entity Framework project that we are building as a school project. For our versioning, we are using Git to Bit Bucket. The basic workflow to add a feature or revamp code is to create a branch off of a Dev branch, commit to the new branch until finished and intial testing is done, then merge/pull request back into the Dev branch. We have run into issues with the project setup breaking when a user tries to merge changes to the their branch before merging back into Dev.

Some questions are:
For the NuGet Packages, what should be included in the Git repo? There are some files that seem to update every time, forcing Git to go through all of them during a commit.

Should the Entity Framework be included in the repo? We have the migrations, but they seem to break any time anyone pulls changes onto their machine.

Is there a good way for Git to handle Visual Studio Project (.csproj) Files? We had a merge nightmare involving project files when one developer pulled changes from the Dev before trying to push back.

For our .gitIgnore, we used an ASP and added a few of our own. A copy of it is at Pastebin.com.

Also, as for the horrific mangling of project files, we have looked on StackOverflow and saw this: .NET + Git: how I deal with Visual Studio files?. Is this something that would resolve the Visual Studio project files issue?

share|improve this question

closed as too broad by gnat, GlenH7, MichaelT, Bart van Ingen Schenau, Matthieu Feb 21 at 21:31

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Keep nuget packages out of source control. They are a headache. We all have a "NugetGrabber" project we use to get the assemblies and put them into repos. The csproj issue is not a git only thing... this happens with all source control systems... you just have to fix conflicts as they come up. –  Simon Whitehead Feb 17 at 6:58

1 Answer 1

I am currently using bit bucket and vs 2013. I left the defaults and have had no issues so far using git.

I can paste the defaults it uses if you want.

share|improve this answer
    
We had an issue where two branched and worked. First one finished and pushed back to dev. Second one finished, had to merge to push back to dev. The merge of the .csproj file was messy. I think the devs wasn't too sure about what to do with merging the .csproj file. I believe we used the defaults as well, but I am going to recreate the repo myself and see if it fixes things XD –  Gilbrilthor Feb 20 at 2:57
    
I haven't run into this issue yet. –  Terry Mar 5 at 21:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.