Jenkins could not run git

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.

enter image description here


It seems Jenkins has been changing a lot. I fixed this problem in March 2017 by doing this:

  1. Go to Manage Jenkins
  2. Go to Global Tool Configuration
  3. In Git / Path to Git executable enter C:\<whatever the path is>\git.exe.
  4. Click on Save.

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

Global Tool Configuration


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.

Tags:

Git

Jenkins