Answers: <p>According to <a href="https://jenkinsci.github.io/job-dsl-plugin/#path/job-scm-git-extensions-cloneOptions-shallow" rel="nofollow noreferrer">the Jenkins Job DSL documentation</a> <code>shallow</code> has to be enabled:</p>
  
  <pre><code>shallow(true)
  </code></pre>
  
  <p><a href="https://i.sstatic.net/Gzo24.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Gzo24.png" alt="enter image description here"></a></p>
  
Answers: CC BY-SA 4.0
Answers: 2019-09-22T19:19:45.617Z
Answers: 2019-09-22T19:19:45.617Z
Answers: 030
Body: <p>Another question that is related to <a href="https://devops.stackexchange.com/q/9225/210">this one</a>. We try to configure the <code>shallow clone</code> using Jenkins Configuration As Code (JCAC). Although a configuration section is <a href="https://jenkinsci.github.io/job-dsl-plugin/#path/multibranchPipelineJob-configure" rel="nofollow noreferrer">available</a>, <code>shallow clone</code> seems to be omitted:</p>
  
  <p><a href="https://i.sstatic.net/q7Nlh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/q7Nlh.png" alt="enter image description here"></a></p>
  
  <p><a href="https://gitter.im/jenkinsci/configuration-as-code-plugin?at=5d87457c5ab9361694381b5d" rel="nofollow noreferrer">Gitter</a></p>
  
Tags: <jenkins><jcac>
Title: How to enable shallow clone using JCAC?
UserDisplayName: 030
ThreadText: # How to enable shallow clone using JCAC?
  
  (Asked by: username_0 on 2019-09-20)
  
  Another question that is related to [this one](https://devops.stackexchange.com/q/9225/210). We try to configure the `shallow clone` using Jenkins Configuration As Code (JCAC). Although a configuration section is [available](https://jenkinsci.github.io/job-dsl-plugin/#path/multibranchPipelineJob-configure), `shallow clone` seems to be omitted:
  
  [![enter image description here](https://i.sstatic.net/q7Nlh.png)](https://i.sstatic.net/q7Nlh.png)
  
  [Gitter](https://gitter.im/jenkinsci/configuration-as-code-plugin?at=5d87457c5ab9361694381b5d)
  
  **Tags:** jenkins, jcac
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-09-22. Score: 1 | Accepted answer
  
  According to [the Jenkins Job DSL documentation](https://jenkinsci.github.io/job-dsl-plugin/#path/job-scm-git-extensions-cloneOptions-shallow) `shallow` has to be enabled:
  
  ```
  shallow(true)
  
  ```
  
  [![enter image description here](https://i.sstatic.net/Gzo24.png)](https://i.sstatic.net/Gzo24.png)
  
  
  ---
  
  