【发布时间】:2017-09-25 17:37:34
【问题描述】:
我正在尝试将 IntelliJ 中的 Git 可执行文件设置为安装在适用于 Linux 的 Windows 子系统中的 git,我尝试了几种不同的方法,但总是出现某种错误。今天我安装到 Creators Update(版本 1703),重新安装了 WSL 并再次尝试,这是我所做的:
我创建了一个 .bat 脚本:
@echo off
C:\Windows\System32\bash.exe -c "git %*"
所以在运行时:
C:\Users\Limon\Desktop>bash.bat --version
git version 2.7.4
然后我尝试在 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.
关于如何解决这个问题的任何想法?我对批处理脚本一无所知。它可以在命令行下完美运行。
【问题讨论】:
标签: batch-file intellij-idea windows-subsystem-for-linux