Git – How should Visual Studio Solutions and Projects mapped to Visual Studio Online GIT Projects and Repos

gitversion controlvisual studio

I have a number of visual studio solutions and projects (many projects may belong to multiple solutions) that I would like to add to Visual Studio Online (GIT Version). An example would be:

Solution 1

  • Project A
  • Project B
  • Project C

Solution 2

  • Project B
  • Project C
  • Project D

Should each Solution be created as a Project? Or Create one VSO Project with each solution and project as their own repo?

Best Answer

You do not want separate VSO projects, that can cause issues if you're using work items and is just an unnecessary overhead unless the code will never be worked on by the same devs.

As for separate repos that's slightly different. Git doesn't really support large repos, however looking at the structure you show it doesn't look like you're going to have gigabytes of code in your solutions.

Probably the best option to start with is a single repo. If the codebase grows then it's fairly easy split the repos up in the future if that makes sense.

As for the fact that solutions share projects, you should probably look at using nuget to turn those in to binary dependencies rather than sharing at the code level. It might make sense then to put the source for those libraries in to a separate repo, but even then don't over think it. Keep it simple and add complexity when required.