6

I am trying to switch WebStorm (WS) to use Windows Linux Subsystem (WLS).

So far I have WLS bash working in cmd and in WS. I am running 64-bit version of WS and in settings->tools->terminal shell path is set to bash.exe. This correctly loads WLS bash into terminal window of WS. However, even though in terminal I can normally use Git commands, I am unable to figure out how to set settings->version control->git path to git executable.

Keep in mind, for WS (and other Intellij products) this is git for the IDE itself. While I don't care that much for it, it is constantly throwing warnings that it can't start Git. Also I find it remotely useful to have that gray color mark on beginning of modified row since last commit in the file editor itself.

Things that I've tried

Path to Git executable:

C:\Windows\System32\bash.exe

errors while executing git --versions. exitCode=-1

C:\Windows\System32\bash.exe -login -i

Cannot run program "C:\Windows\System32\bash.exe -login -i": CreateProcess error=2, The system cannot find the file specified

"C:\Windows\System32\bash.exe" -login -i

Cannot run program ""C:\Windows\System32\bash.exe" -login -i": CreateProcess error=87, The parameter is incorrect

"C:\Windows\System32\bash.exe" --login -i

Cannot run program ""C:\Windows\System32\bash.exe" --login -i": CreateProcess error=87, The parameter is incorrect


In contrast, while running Git Bash for Windows, the correct path would be “C:\Program Files (x86)\Git\bin\sh.exe” –login -i

I am tagging other Intellij products as well, since this question should be universal for most of them if not all.

Addition information (based on comments)
I do not have git installed in windows, git only exists inside WLS.

Miroslav Saracevic
  • 1,446
  • 1
  • 13
  • 32
  • Add `C:\Program Files (x86)\Git\bin\sh.exe` path in `settings->version control->git`. Make sure `sh.exe` exists in that location. – Sajib Khan Nov 27 '16 at 15:10
  • Is `C:\Users\\AppData\Local\Programs\Git\bin\git.exe` exists in your machine? If not then find your `git.exe` in `C:` drive and set it as your WS git path. – Sajib Khan Nov 27 '16 at 15:22
  • 2
    @sajibkhan please read the question again. There is no git installed on windows. I want to use git from Windows Linux Subsystem which is part of Windows 10 developer tools... – Miroslav Saracevic Nov 27 '16 at 15:40
  • 1
    I have run into the same issue, and was wondering as well if there is a way to make Intellij etc. use git on the windows linux subsystem. – N.Schipper Nov 28 '16 at 23:50
  • 1
    from what I read, this is issue with WLS 'not exposing' git. Apparently visual studio or one of those IDE's has the same feature and people can't get it to work either. Unfortunately I can't find source now, but it was discussed in one of the google groups and on windows forums. I guess we can just wait for the time being and still have double dependancy (one with WLS running dev environment and everything, and other with git bash for windows with just ssh keys loaded up). – Miroslav Saracevic Nov 30 '16 at 11:14
  • I wonder whether https://gist.github.com/ftk/e55ad62656baca20c2aa2c05c5f75f0d would solve this. – chx Apr 21 '17 at 04:17
  • I've [provided the answer here](http://stackoverflow.com/a/43668457/104891). – CrazyCoder Apr 27 '17 at 21:49
  • That was my though exactly when I saw creators update notes, will wait for it and see if it can be done then without hacks / workarounds. – Miroslav Saracevic Apr 28 '17 at 08:08

0 Answers0