Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio is not recognizing git repo

Upon opening my ASP.NET Core project with an existing git repo in Visual Studio 2022, the git repo is not being loaded. However, opening a freshly cloned repo of this project from GitHub works fine. And opening other projects with git repos work fine. What could be the issue?

like image 553
rajndev Avatar asked Sep 10 '25 12:09

rajndev


2 Answers

Had the same issue after upgrading to latest version of VS2019 and had a look at the output from "Source Control - Git", there were messages of a fatal error because of no access and suggesting running the following:

git config --global --add safe.directory path/to/repo

After running it and restarting VS2019 it works OK.

like image 88
patriml Avatar answered Sep 13 '25 06:09

patriml


If you run VS 2022 as an Administrator, it should load everything as it should.

like image 29
dpdragnev Avatar answered Sep 13 '25 07:09

dpdragnev