I am running into the same issue except in my case it makes no sense to move the files from the 2nd project under the first. The first project that GIT is managing is a .NET framework desktop application and the new project is a SQL Server CLR stored procedures project - they need to be separate projects. What is the process to add the 2nd project in the solution under GIT source control in Azure DevOps?
How do I add a project to Git (solution already added)

Hi all;
This is weird, I have a solution with one project that is all in Git/DevOps. I created it and added it through VisualStudio. This is all working fine.
I added a UnitTest project to the solution and it's added fine. But this project is not added to Git.
And all the expected menu items to "add to Git" don't exist. It's like VisualStudio thinks it's added, but it isn't.
Part of the problem may be that both projects are in peer folders and the .sln file is in the folder of the main project.
How do I fix this?
thanks - dave
4 answers
Sort by: Most helpful
-
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
-
Fevzi KARTAL 0 Reputation points
2024-11-21T07:59:51.31+00:00 Git is based on your local repository folder not on Visual Studio Solution structure.
If you want to have many project under same solution and use Git for source code, Then you need to add your project into both of the same folder and the same solution.
-
Greg Gum 11 Reputation points
2025-01-04T05:32:14.8966667+00:00 The issue: You add a project to your solution, but GIT does not recognize it, so it is not in source control.
The problem: When you created your project in Visual Studio, the Solution and the Project were placed in the same folder. Then, later, when you add a new project, it is not created in the solution folder, it is created in a sister folder which is not under git.
The solution: Create a new Project. When you do this, ensure that the checkbox which says "Place Project and Solution in the same folder" is NOT checked. Then the Project will be in it's own folder UNDER the solution folder. When you create a new project, it will then be under the solution folder, and thus it will be recognized by git and included in source control.