我试图将IntelliJ中的Git可执行文件设置为Windows子系统for Linux中安装的git,我尝试了几种不同的方法,但总是遇到某种错误.今天我安装了Creators Update(版本1703),重新安装了WSL并再次尝试,这就是我所做的:
我创建了一个.bat脚本:
@echo off
C:\Windows\System32\bash.exe -c "git %*"
Run Code Online (Sandbox Code Playgroud)
所以在运行时:
C:\Users\Limon\Desktop>bash.bat --version
git version 2.7.4
Run Code Online (Sandbox Code Playgroud)
那么我试着在IntelliJ中的git可执行文件中设置这个bat:

它奏效了!但其他一切都失败了,例如当我尝试在IntelliJ中拉或分支时,我得到:
Couldn't check the working tree for unmerged files because of an error.
'C:\Windows\System32\bash.exe' is not recognized as an internal or external command,
operable program or batch file.
Run Code Online (Sandbox Code Playgroud)
关于如何修复这个的任何想法?我对批处理脚本并不了解.它在命令行下完美运行.