如何使用 bat 文件进入带有 git bash 的特定目录后执行 gulp 命令?

How to execute the gulp command after going into a particular directory with git bash using bat file?

这是我正在执行的一个bat文件。它确实会在特定文件夹中打开 git bash,但不会在 git bash 命令行上执行 gulp 命令。我该怎么做?

C: cd C:\xampp\htdocs\wordpress\wp-content\themes\gulp-dev start "" "%PROGRAMFILES%\Git\bin\sh.exe" --login

首先,将前两行替换为:

,而不是 C:
cd /d C:\xampp\htdocs\wordpress\wp-content\themes\gulp-dev

/d 如有必要将更换驱动器。

二、补充:

start /b "%cd%" "%PROGRAMFILES%\Git\bin\sh.exe" --login

第三,如果你想execute a command on shell opening

...sh.exe" --login -i -c "my command"