# Help with a pipline script that i can't seem to understand

**URL:** <https://community.jenkins.io/t/help-with-a-pipline-script-that-i-cant-seem-to-understand/2550>\
**Category:** Using Jenkins\
**Created:** [May 26, 2022, 9:18am UTC](https://community.jenkins.io/t/help-with-a-pipline-script-that-i-cant-seem-to-understand/2550 "2022-05-26T09:18:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ayoubelkass](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/ayoubelkass/32/1360_2.png) [@ayoubelkass](https://community.jenkins.io/u/ayoubelkass)\
**Post date:** [May 26, 2022, 9:18am UTC](https://community.jenkins.io/t/help-with-a-pipline-script-that-i-cant-seem-to-understand/2550/1 "2022-05-26T09:18:27Z")

</div>

i have a declarative pipeline that was causing me some problems lately. i put my hand on the block of script that was the source of the problem but since i’m new to jenkins i can’t figure out what it does exactly and here is the block :

checkout changelog: true, poll: true, scm: [

```
            $class: 'GitSCM',

            branches: [[name: "origin/${env.gitlabSourceBranch}"]],

            doGenerateSubmoduleConfigurations: false,

            extensions: [[$class: 'PreBuildMerge', options: [fastForwardMode: 'NO_FF', mergeRemote: 'origin', mergeStrategy: 'DEFAULT', mergeTarget: "${env.gitlabTargetBranch}"]]],

            submoduleCfg: [],

            userRemoteConfigs: [[credentialsId: "${env.GIT_REPO_CREDENTIAL_ID}",name: 'origin', url: pipelineParams.scmUrl]]

            ]

```

can someone please help me figure out what this does exactly when i run it through a jenkins build ?  
P.S : this block is inside of a try/catch

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [May 26, 2022, 9:15pm UTC](https://community.jenkins.io/t/help-with-a-pipline-script-that-i-cant-seem-to-understand/2550/2 "2022-05-26T21:15:26Z")

</div>

Declarative pipelines by default clone the related SCM repos. That command is explicitly checking out (cloning) the associated repo, I think maybe a different branch or something?

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [May 30, 2022, 8:06am UTC](https://community.jenkins.io/t/help-with-a-pipline-script-that-i-cant-seem-to-understand/2550/3 "2022-05-30T08:06:17Z")

</div>

A post was split to a new topic: [ERROR: Couldn’t find any revision to build](https://community.jenkins.io/t/error-couldn-t-find-any-revision-to-build/2580)
