You cannot clone a git repository from a network drive

Jalza 781 Reputation points
2024-03-18T14:39:04.8466667+00:00

I am using Visual Studio Professional 2019 and I have to work with a repository that is located in a folder on a network drive. The remote repository is in this location:

I:\COMPANY PROJECTS\PR0XX-MYPROJECT\CODE\MYPROJECT_Desktop_Simulator.git

I follow the steps below:

  • When I open Visual Studio I click on the option "Clone a repository".
  • In the next window I select the remote folder where the repository is located and the local folder where I want it to be cloned. I tried writing remote repository location like these: I:\COMPANY PROJECTS\PR0XX-MYPROJECT\CODE\MYPROJECT_Desktop_Simulator.git or file://I:%5CCOMPANY%20PROJECTS%5CPR0XX-MYPROJECT%5CCODE%5CMYPROJECT_Desktop_Simulator.git

I get the following error:

Git failed with a fatal error.

'I:\COMPANY PROJECTS\PR0XX-MYPROJECT\CODE\MYPROJECT_Desktop_Simulator.git' does not appear to be a git repository

Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

If clone the repository using another tool like Git Bash or VS Code (with file://...) I can see change history, create new commits in local repository, but I can't push or pull.

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

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.