Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Visual Studio 2022 not detecting git changes new project

I created a new web api project in visual studio 2022, just using the master branch created a repository in GIT and whenever I make changes to that project the VS detects where I can commit, but when I create a new project for example a Class Library it does not detect any change I make to it even a new class.

This is getting frustrating, created it three times in different directories.

Restarting device and VS did not help.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Folder Structure:

F:\MyProject\MyProject\git

F:\MyProject\MyProject\MyProject.sln

F:\MyProject\MyProject.ClassLibrary

>Solution :

Folder Structure:
F:\MyProject\MyProject\git
F:\MyProject\MyProject\MyProject.sln
F:\MyProject\MyProject.ClassLibrary

That’s the problem. The Git repository is more of a file system concern than a Visual Studio Solution concern. If the new project is outside of that folder structure then Git doesn’t see it, for the same reason it doesn’t see the rest of your hard drive.

Initialize the Git repository in the root of everything you want it to track, not just in one project folder. (Or, conversely, add new files under the folder where Git was initialized, rather than outside of it.)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading