0

I have a common Git Repos that has shared projects that I want to include and then another Git Repos for my application. I'm using VS2017 and the application solution with it's nested projects are all under Git version control and work fine, but when I add a project from the Common folder, which is also under Git and cloned from the same TFS VS doesn't treat it as being versioned or linked to Git.

Any ideas?

MrTelly
  • 14,657
  • 1
  • 48
  • 81

1 Answers1

0

Visual studio doesn't support multiple separate git repositories in the same solution. You need to either use a separate git client or setup a overarching repo that uses Git Subtree or Git Submodules to include the common library.

Converting to a mono-repo is also an option. Then they're both in a single repository.

Or you can setup NuGet publishing for the Common package and reference it that way.

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
  • I was hoping to implement shared projects - https://stackoverflow.com/questions/1116465/how-do-you-share-code-between-projects-solutions-in-visual-studio - and use Git. Is there a better solution? – MrTelly Aug 06 '19 at 22:04
  • You can put all shared projects in a single git repo (monorepo). Or you can use NuGet package references between these projects. Or you can use a different Git client. – jessehouwing Aug 07 '19 at 08:12
  • Disadvantage of sharing the sources between multiple projects in a single VS instance is that you don't know what you are breaking in the other projects. Hence, it's better to have to edit the shared project more deliberately. – jessehouwing Aug 07 '19 at 08:14