在Windows gitlab ci中无法识别Git

问题描述 投票:3回答:4

我配置了一个gitlab运行器,如下所述:https://docs.gitlab.com/runner/install/windows.html

不幸的是,当我推送到我的存储库时,我的管道失败了:

Running with gitlab-runner 10.5.0 (80b03db9)
  on windows runner 79cb4019
Using Shell executor...
Running on WINSTD-45-13...
'"git"' is not recognized as an internal or external command,
operable program or batch file.
'"git"' is not recognized as an internal or external command,
operable program or batch file.
Cloning repository...
'"git"' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
Checking out b05fd8be as master...
'"git"' is not recognized as an internal or external command,
operable program or batch file.
ERROR: Job failed: exit status 9009

当我以管理员身份打开命令行实用程序时,git可用。

知道为什么管道脚本中没有识别git

git gitlab-ci
4个回答
2
投票

我自己解决了这个问题:我的.gitlab-ci.yml脚本正在重新定义PATH环境变量。


1
投票

对我来说,在我启动PowerShell运行gitlab-runner之后,我安装了git。要解决此问题,您需要在安装git后重新启动PowerShell,然后重新启动gitlab-runner以获取PATH上的git。


0
投票

在C:\ Git上安装Git而不是c:\ Program Files ...为我解决了这个问题。


0
投票

我的跑步者安装在Amazon EC2实例上,我在安装跑步者后安装了git。我发现重新启动整个EC2实例修复了它。重启服务还不够。

© www.soinside.com 2019 - 2024. All rights reserved.