How do I add a project to Git (solution already added)

David Thielen 3,136 Reputation points
2022-04-05T17:50:51.987+00:00

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

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,225 questions
{count} votes

3 answers

Sort by: Most helpful
  1. David Christian 110 Reputation points
    2023-05-18T12:50:33.79+00:00

    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?

    0 comments No comments

  2. 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

  3. 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.Git Repository

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.