title: Run Jenkins Pipeline with Code from Git
body: <p>I want to use following Pipeline script from git in jenkins</p>
  
  <pre><code>#!groovy
  pipeline {
      agent any
  
      stages {
          stage('Build') {
              steps {
                  echo 'Building..'
              }
          }
          stage('Test') {
              steps {
                  echo 'Testing..'
              }
          }
          stage('Deploy') {
              steps {
                  echo 'Deploying....'
              }
          }
      }
  }
  </code></pre>
  
  <p>I set the Repository URL right, under "Additional Behaviors" i added "Check out to a sub-directory" and wrote my sub directory there.</p>
  
  <p>At "Script-Path" I wrote: mysubdirectory/Jenkinsfile</p>
  
  <p>When I try to run it I get following ERROR:</p>
  
  <pre><code>java.io.FileNotFoundException
      at jenkins.plugins.git.GitSCMFile$3.invoke(GitSCMFile.java:167)
      at jenkins.plugins.git.GitSCMFile$3.invoke(GitSCMFile.java:159)
      at jenkins.plugins.git.GitSCMFileSystem$3.invoke(GitSCMFileSystem.java:162)
      at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:71)
      at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:158)
      at jenkins.plugins.git.GitSCMFile.content(GitSCMFile.java:159)
      at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:338)
      at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:101)
      at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:59)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:262)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:415)
  Finished: FAILURE
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>How can I run a Jenkins Script from git correctly?</p>