2
votes

I have multiple projects under one solution and I would like to add them to the same Git repo on Visual Studio team services.

For example in the Solution I have:

  1. The main application Project
  2. The admin application Project
  3. A data access logic Project

As the first two projects are totally dependent on the third project I would like to add them to the same repository.

I am using Visual Studio 2015 and Git. These are also MVC, C# projects.

Is it possible to have multiple projects, from the a single Solution, in the same Visual Studio Team Services repository?

If not, I can't seem to upload any of the projects to a different repository (from the same Solution), is this possible?

I would ultimately like to avoid needing to switch solutions while developing.

2

2 Answers

0
votes

Is it possible to have multiple projects, from the a single Solution, in the same Visual Studio Team Services repository?

Yes, absolutely. A repository (a Git repository, in this case) can contain any set of files & folders that you wish to manage in source control. Think of it essentially as a top level folder / collection.

Normally, yes, you would have the entire solution and child projects in the same repository. If I interpret your question correctly, I think you are just asking how to add the projects into the repository, which is really just git question - just add all your project files/folders into the git repository and commit them.

Based on your question, maybe your git repository (the .git folder on your file system) sits at the level of your project folder? If that's the case, you might be asking basically how to move this up? If that's the case, see similar questions here:

Moving a git repository up one hierarchy level

My Git repository is in the wrong root directory. Can I move it? (../ instead of ./)

Feel free to clarify if I have misunderstood your question.

0
votes

Yes, it is possible.

  1. Clone a Git repo from VSTS in Visual Studio 2015, and copy your solution with the 3 projects under this repo.
  2. Add the solution to git. You could open the solution using VS 2015 and right click the solution choosing "Add solution to Source Control"
  3. Commit your changes.
  4. Push your repo to VSTS.

Both the above actions you could do it in Visual Studio or using Git command.