Andreas Köberle Andreas Köberle - 1 year ago 152
Git Question

Jenkins could not run git

I've installed Jenkins on my mac (osx lion). But I couldn't get it work. This is the stacktrace I've got:

Started by user anonymous

Checkout:workspace / /Users/Shared/Jenkins/Home/jobs/test/workspace - hudson.remoting.LocalChannel@1c0a0847
Using strategy: Default
Checkout:workspace / /Users/Shared/Jenkins/Home/jobs/test/workspace - hudson.remoting.LocalChannel@1c0a0847
Cloning the remote Git repository
Cloning repository origin
Error trying to determine the git version: Error performing command: /usr/local/git/ --version
Cannot run program "/usr/local/git/" (in directory "/Users/Shared/Jenkins/Home/jobs/test/workspace"): error=13, Permission denied
Assuming 1.6
ERROR: Error cloning remote repo 'origin' : Could not clone
ERROR: Cause: Error performing command: /usr/local/git/ clone -o origin /Users/Shared/Jenkins/Home/jobs/test/workspace
Cannot run program "/usr/local/git/": error=13, Permission denied
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone
at hudson.plugins.git.GitSCM$2.invoke(
at hudson.plugins.git.GitSCM$2.invoke(
at hudson.FilePath.act(
at hudson.FilePath.act(
at hudson.plugins.git.GitSCM.checkout(
at hudson.model.AbstractProject.checkout(
at hudson.model.AbstractBuild$AbstractRunner.checkout(
at hudson.model.AbstractBuild$
at hudson.model.ResourceController.execute(

Answer Source

The solution for me was to set the git path in the Manage Jenkins > Configure System settings. In the Git section, I changed the Path to Git executable to /usr/local/bin/git.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download