Visual Studio Code cannot detect cygwin git.exe path

I’ve just started using Visual Studio Code (on Windows) for new UI project I’ve just joined. I have my Path environment variable configured to point to my cygwin git executable as follows:


  • Git showing identical files as changed
  • How do you specify git URLs with spaces on Windows under cygwin?
  • Git on Cygwin: Fails to add the host to the list of known hosts
  • cygwin cannot exec 'git-add--interactive' permission denied
  • Cygwin SSH connection issue to BitBucket
  • git and Cygwin Paths with SourceTree
  • I’ve verified that this is working by opening a Windows command prompt and successfully executing Linux commands. However, when I open the git project in Visual Studio Code, which looks to the path to resolve its “git.path” configuration, I get the following error:

    ENOENT: no such file or directory, lstat ‘C:\cygdrive’

    Explicitly configuration the Workspace Settings file (settings.json) doesn’t work either.

    Any ideas?

  • How to notify GitHub contributors to my repo that a npm dependency has been updated?
  • git update-index --assume-unchanged - but the file is still occasionally updated
  • How Do I Get Back Untracked Files I Stashed with Git?
  • Maintaining Git repo inside another git repo
  • How do I show that I'm getting the smallest number of conflicts with Git by using K&R instead of B&D as the coding standard?
  • Removing remote Git branch using JGit
  • 3 Solutions collect form web for “Visual Studio Code cannot detect cygwin git.exe path”

    just create a symlink (windows): open a cmd prompt and use the following command:

    mklink /j "C:\cygdrive" C:\actual\path\to\your\cygdrive

    PS: For babun users, it would be your home directory:

    mklink /j "c:\home" C:\Users\{user}\.babun\cygwin\home

    I can not commet.
    For babun users, the command should be

    mklink /j "c:\cygdrive" C:\Users\{user}\.babun\cygwin\home

    And after that, if you put your code in other path rather than under home, you should link the driver to home.For example, if your code path is D:\Codes\MyProject, you should run the command

    mklink /j "C:\Users\{user}\.babun\cygwin\home\d" D:

    I had a similar problem. Here is what fixed the issue for me.

    • I had to include git.exe in the path. On my system it looks like this: "git.path": "D:\\Programs\\Git\\bin\\git.exe". VS Code seems to expect that the file is included in this path rather than just the folder location of the executable.
    • I had to restart VS Code for the git path setting change to take effect.

    I hope this helps.

    Git Baby is a git and github fan, let's start git clone.