0

I am working on an MVC5 application where the Entity Framework data access layer is generated with Entity Developer.

We keep source in Git (Git flow) and I have merge conflict issues every time the model changes in a feature when I try rebasing with our main branch.

For example, I am working on a feature which is many commits ahead of develop - when I try rebasing the first issue looks like this:

Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add <file>..." to mark resolution)

    both modified:   App.Models/App.Base.view
    both modified:   App.Models/App.PregeneratedViews.cs
    both modified:   App.Models/App.edml
    both modified:   App.Models/App.ssdl

Can anyone offer a strategy or advice of how to deal with merge conflict issues arising from using model-first generated code as above?

  • How can I work with a Git flow process and model-first generated code?
  • How do others deal with these types of problems?
  • Should I push for us to ditch model-first and go code-first? (This is the only solution I can see at the moment)

(I realise this might be opinion-based but I believe others will have the same types of problems making the question relevant?)

Vinyl Warmth
  • 2,226
  • 3
  • 25
  • 50

1 Answers1

1

Well, the solution is simple. Never ever ever ever add generated code to a VCS. Generated code is a build artifact and build artifact have nothing to do in a VCS. They just duplicate the information that is already present in the generation source and thus should not be versioned. This way you will also not have merge conflicts in them, you simply generate the new versions as part of your build.

Vampire
  • 35,631
  • 4
  • 76
  • 102