Search code examples
gitvisual-studiotfsvisual-studio-2017

"Illegal characters in path" while cloning with git from Visual Studio 2017


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

Solution

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