6

On Visual Studio 2017, I can not clone a repository with git. I'm having this error message:

enter image description here

The repository url is good and the destination folder is also fine (no spaces or special characters). I tried on another computer and everything works perfectly. When I'm cloning the same project with GitKraken, SourceTree or in command line, everything works. I tried to uninstall git, cleaning my tfs/git credentials, uncheck "Git for Windows" option on the Visual Studio installer, in vain....

Has anyone ever had the same problem? How did you solve it? Thanks for the help!

Visual Studio 2017: 15.9.11
Git version: 2.21.0
Git url path: https://tfs.mysubdomain.mydomain.fr/dev/PROJECT/_git/PROJECT
TFS Server: https://tfs.mysubdomain.mydomain.fr/dev/PROJECT/PROJECT%20Team/_git/PROJECT
Régis NIOX
  • 741
  • 2
  • 12
  • 30
  • pretty hard to see what might be the issue ... without seeing the full git url or path... – Shahar Hadas Apr 09 '19 at 10:07
  • other git repos (some public from github) works? – Shahar Hadas Apr 09 '19 at 10:17
  • I update the post. And yes I tried with some public from github and I had the same issue – Régis NIOX Apr 09 '19 at 10:29
  • 2
    For some reason could be the %20 (space) gives some unexpected issue? Possible to try another one, from the same TFS without %20 or from github with a %20 in it? to try and isolate the issue? – Shahar Hadas Apr 09 '19 at 10:38
  • @ShaharHadas I tried with an url like this: `https://domain.visualstudio.com/Project/_git/Project`. Same issue. – Régis NIOX Apr 09 '19 at 12:04
  • What if you clone using any other tool, and then just open the project inside visual studio? It reports the issue also then? – Shahar Hadas Apr 09 '19 at 12:07
  • Yes. If I clone it with another tool and open it with Visual Studio, I'm having the same issue: I cannot fetch or pull because for Visual Studio I have to clone the opened project first... Non sense. It's as if the folder was not tracked – Régis NIOX Apr 09 '19 at 12:22

4 Answers4

3

I'm not sure what's the cause of it. I've been running git commands in the Windows Terminal. And the same problem happened when I try to pull in Visual Studio.

Here's how I got the problem resolved:

Restart the computer
Lok C
  • 393
  • 1
  • 4
  • 13
0

I finally fixed it by this way:

  • uncheck the "Git for Windows" checkbox in Visual Studio Installer
  • uninstall git (for me it was version 2.21.0)
  • uninstall other git apps (for me it was GitKraken and SourceTree)
  • delete all git and tfs credentials via the credential manager
  • reboot (just in case)
  • install git
  • launch visual studio and connect to the TFS server
  • you can now clone and work peacefully

Et voilà :)

Everything works perfectly now. I think uninstall only git was not enough. I don't really understand why I had this issue but the bulldozer strategy was efficient.

Régis NIOX
  • 741
  • 2
  • 12
  • 30
  • The git version bundled with Visual Studio interfered with the standalone git version? – Shahar Hadas Apr 09 '19 at 20:29
  • I don't really know because what I did before was to uncheck "Git for windows" to force Visual Studio to not use a the potential git version bundled with Visual Studio... At least I thought. I also had 2 others apps (GitKraken and SourceTree). Maybe I had some version conflicts between all these apps. – Régis NIOX Apr 10 '19 at 06:30
0

I finally fixed it by deleting index.lock in /git folder

-1

I've resolved this by deleting .\obj and .\bin folders in my startup project.

knile
  • 318
  • 3
  • 15