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 /
I had the correct path to git in Jenkins, but I had not yet accepted the Xcode build tools EULA on a fresh install of OS X Yosemite, so git looked like it was failing in Jenkins. After trying "git --version" on the git at /usr/bin/git in a terminal, I was given a command-line interface to accept the EULA, and then Jenkins could then access the git URL I had given the build project.
Also you can set Git location in Jenkins server/node configuration:
goto Configure, under section Node Properties mark checkbox Tools Location and set yours path to Git.
It seems Jenkins has been changing a lot. I fixed this problem in March 2017 by doing this:
Git / Path to Git executable
enter C:\<whatever the path is>\git.exe
.I had similar problem, the solution for Windows looks the same (my Jenkins is installed on a Windows machine):
Global settings:
Go to Manage jenkins -> Configure System -> Git installations
add there the git exe path (for example: C:\Program Files\Git\bin\git.exe
), or you can use environment variable.
For Jenkins version 2.121.3, Go to Manage jenkins -> Global tool configuration -> Git installations -> Path to Git executable: C:\Program Files\Git\bin\git.exe
Jenkins job side:
Go to Source code Management -> select git, add your repository, choose connection to repository (http/ssh) and add credentials and it should work.
In case the Jenkins is triggering a build by restricting it to run on a slave or any other server (you may find it in the below setting under 'configure')
then the Path to Git executable should be set as per the 'slave_server_hostname' or any other server where the git commands are executed.
I got a very similar error when my Jenkins agent was running Java 11 instead of Java 8. It had nothing to do with configuring my git path! Downgrading the agent to Java 8 was the only solution I found.