7

我已经在 Centos 5.7 上成功安装了 git,

$ git --version git 版本 1.7.4.1

在从 jenkins 的 github 中提取源代码时,我面临以下问题

Caused by: java.io.IOException: Cannot run program "git": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:709)
at hudson.Launcher$ProcStarter.start(Launcher.java:338)
at hudson.Launcher$ProcStarter.join(Launcher.java:345)
at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:774)

Jenkins 无法识别 git 二进制文件。

请帮助我

4

2 回答 2

4

您还可以基于每个节点覆盖 git 路径。只需转到节点的配置页面,然后检查Tool Locations并提供该系统上的 git 路径。

在 OSX 上,这是/usr/local/git/bin/git给我的。您可以通过which git在您的节点上以 jenkins 用户身份执行来确定它。

于 2012-08-23T12:13:25.750 回答
2

Jenkins needs to know where your git binary file is installed; this is usually at /usr/bin/git on Linux systems. Go to the /configure page of your Jenkins installation (the "Manage Jenkins" link) and set it up in the "Git" section.

于 2012-06-20T16:45:06.263 回答