Jenkins giving error while cloning from gitHub

I am new to Jenkins, I am getting following error while cloning repository from GitHub.

I tried to search all relevant issues here but could find exact stacktstrace with answers.

  • Git - phantom local commits
  • How to clone git repository with nodegit using ssh
  • Unable to add plugins with Cordova 3.3.0 CLI on Windows - '“git” command line tool is not installed: …"
  • How do I git-add with wildcards when ignored files are present?
  • Msysgit git svn character encoding
  • VSTS build failed with Git fetch failed with exit code: 128
  • I am trying to clone repository which requires username and password, I am providing SSH:// repository-path in job configuration settings for my job. I have not done any .ssh related settings yet as this seems to be different problem than security issue with GIT repository.

    I couldn’t figure out what comment Jenkins is trying to execute, which file/directory it is not finding clueless.

    Here is my exact stack trace from Jenkins job:

    Caused by: Cannot run program: Error trying to
    determine the git version: Error performing command: –version
    Assuming 1.6
    ERROR: Error cloning remote repo ‘myRE’ : Could not clone
    hudson.plugins.git.GitException: Could not clone
    at hudson.plugins.git.GitAPI.clone(
    at hudson.plugins.git.GitSCM$2.invoke(
    at hudson.plugins.git.GitSCM$2.invoke(
    at hudson.FilePath.act(
    at hudson.FilePath.act(
    at hudson.plugins.git.GitSCM.checkout(
    at hudson.model.AbstractProject.checkout(
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(
    at jenkins.scm.SCMCheckoutStrategy.checkout(
    at hudson.model.AbstractBuild$
    at hudson.model.Run.execute(
    at hudson.model.ResourceController.execute(
    Caused by: hudson.plugins.git.GitException: Error performing command: clone -o RVL.myProj
    at hudson.plugins.git.GitAPI.launchCommandIn(
    at hudson.plugins.git.GitAPI.access$000(
    at hudson.plugins.git.GitAPI$1.invoke(
    at hudson.plugins.git.GitAPI$1.invoke(
    at hudson.FilePath.act(
    at hudson.FilePath.act(
    at hudson.plugins.git.GitAPI.clone(
    … 13 more
    Caused by: Cannot run program “”: error=2, No such file or directory
    at java.lang.ProcessBuilder.start(Unknown Source)
    at hudson.Proc$LocalProc.(
    at hudson.Proc$LocalProc.(
    at hudson.Launcher$LocalLauncher.launch(
    at hudson.Launcher$ProcStarter.start(
    at hudson.Launcher$ProcStarter.join(
    at hudson.plugins.git.GitAPI.launchCommandIn(
    … 19 more
    Caused by: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.(Unknown Source)
    at java.lang.Pro

  • File disappears/reappears in git
  • Does git reuse blobs?
  • gerrit setup for my git server
  • Name or service not known
  • how to apply a git patch as if the author committed to my repo?
  • How to Organize related applications into git repo's?
  • 4 Solutions collect form web for “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”:

    [ 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.

    Git Baby is a git and github fan, let's start git clone.