Reputation: 65
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:
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.
Upvotes: 4
Views: 14795
Reputation: 111
I had the same problem, TLDR this will work if your projects in that solution are located under one main dir. for example
Drive\ProjectX\Proj1 Drive\ProjectX\Proj2 Drive\ProjectX\Proj3
In my case i had my solution (.sln) and (.git) in Proj1 folder which was synced to my repo.
Then i did this
mv "Drive\ProjectX\Proj1\.git" "Drive\ProjectX\.git"
cd "Drive\ProjectX" git add . git commit -a git push
Not sure how to do that if you have projects located outside solution folder such as
Drive\ProjectY\Proj4
I'm in no way or shape pro in these things, this is what helped me to get my separate projects to sync with git when i make changes in the whole solution.
Upvotes: 2
Reputation: 4192
Yes, it is possible.
Both the above actions you could do it in Visual Studio or using Git command.
Upvotes: 0
Reputation: 2076
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.
Upvotes: 5