<p>I have a declarative build pipeline in Jenkins. The project is a multibranch project and uses the Jenkins Kubernetes Plugin to spawn build pods.</p>

<p>I ran into the problem, that the initial checkout of the branch fails. The job searches for git in the wrong path.</p>

<p>Git is is globally configured for Windows based Jenkins nodes, which leads to the following error:</p>

<pre><code>Caused by: java.io.IOException: Cannot run program "C:\Program Files\Git\bin\git.exe" (in directory "/home/jenkins/workspace/P_mybuildpod-«id»"): error=2, No such file or directory
</code></pre>

<p>I can't change this because this will have impact on other projects.</p>

<p>I already tried to add another tool <code>"linuxgit:/usr/bin/git"</code> and configure it in the pipeline by <code>tools { git 'linuxgit'}</code>, but according to <a href="https://issues.jenkins-ci.org/browse/JENKINS-54334" rel="nofollow noreferrer">https://issues.jenkins-ci.org/browse/JENKINS-54334</a>, this is currently not working.</p>

<p>Someone has similar experiences and maybe a good solution for that?</p>

<p>In the Jenkins Settings is an option to define a "Tools" section for pods. Therefore I need to inherit a global podTemplate. But I would prefer to prevent this (especially because I'm using a declarative approach).</p>

Oliver Probst
<p>I found a sufficient solution: I disabled the default checkout and do it manually in the pipeline.</p>

<pre><code>    options { 
        skipDefaultCheckout(true)
    }
</code></pre>
