Jenkins giving error while cloning from gitHub

I encountered and fixed the same problem :)

There are two way to configure the path of git:

  1. On Jenkins Master

    a. Enter Jenkins System Configure (Jenkins -> Manage Jenkins -> Configure System )

    b. Find the Git item and Configure the git installation (specify the git path on Jenkins Master)

  2. On Jenkins Slave

    a. Enter Jenkins Slave's Configure

    b. Check the "Tool Locations" Checkbox and specify the path of git on the Jenkins Slave.

In my situation, I don't have the privilege to access the Jenkins Master. So I install the git on the Jenkins Slave and add it to Jenkins Slave's Configure.


This seems to be a bug, see JENKINS-16523 where I posted a workaround.


I went through the same issue.

I noticed the mixture of git configuration in individual jobs "/var/lib/jenkins/jobs/job_name/config.xml":

[[email protected] jobs]# find . -maxdepth 2 -name     config.xml|xargs grep '<gitTool>'
./job1/config.xml:    <gitTool>git</gitTool>
./job2/config.xml:    <gitTool>Default</gitTool>
./job3/config.xml:    <gitTool>git</gitTool>
./job4/config.xml:    <gitTool>Default</gitTool>

So I fixed the name of gitTool and restarted the Jenkins. It looks like the git configuration doesn't properly and the change of git is not propagated to all jobs.

Also be aware that the git configuration can differ in .xml file with configuration and the configuration in webface of the Jenkins!!!


  1. Run git --version on either Master or Slave
  2. If you do not get anything, that means Git is not installed
  3. If you think Git is installed, add path of the Git executable (e.g. C:\Program Files\Git\cmd) to the PATH environment variable
  4. Run git --version on either Master or Slave and make sure that you get the valid version