I am new to Jenkins
, I am getting following error while cloning repository from GitHub
.
I tried to search all relevant issues here but coul
I encountered and fixed the same problem :)
There are two way to configure the path of git:
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)
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.
git --version
on either Master or SlavePATH
environment variablegit --version
on either Master or Slave and make sure that you get the valid versionI went through the same issue.
I noticed the mixture of git configuration in individual jobs "/var/lib/jenkins/jobs/job_name/config.xml":
[root@jenkins.example.com 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!!!
I came across same issue after I created a new JOB
, fixed it correcting the slave name (with GIT
Installed) in Label Expression
under Restrict where this project can be run
.
Except for step answered by superlee, you need config your node properties for your server side, the Tool Locations if your local is windows system, refer to below screenshot:
tool location for your server side