Jenkins giving error while cloning from gitHub

前端 未结 7 1162
没有蜡笔的小新
没有蜡笔的小新 2020-12-29 21:05

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

相关标签:
7条回答
  • 2020-12-29 21:36

    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.

    0 讨论(0)
  • This seems to be a bug, see JENKINS-16523 where I posted a workaround.

    0 讨论(0)
  • 2020-12-29 21:43
    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
    0 讨论(0)
  • 2020-12-29 21:44

    I 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!!!

    0 讨论(0)
  • 2020-12-29 21:54

    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.

    0 讨论(0)
  • 2020-12-29 21:54

    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

    0 讨论(0)
提交回复
热议问题